3 Commits

Author SHA1 Message Date
joyqi
2fe1c0f26e fix request query parsing 2024-01-25 18:43:41 +08:00
joyqi
25cc1ff3dc fix autosave effect 2024-01-24 18:56:01 +08:00
joyqi
bd6a6a0e0e attach timestamp to image url 2024-01-24 17:54:56 +08:00
6 changed files with 12 additions and 8 deletions

View File

@@ -12,7 +12,7 @@ include 'menu.php';
<div class="row typecho-page-main">
<div class="col-mb-12 col-tb-8" role="main">
<?php if ($attachment->attachment->isImage): ?>
<p><img src="<?php $attachment->attachment->url(); ?>"
<p><img src="<?php $attachment->attachment->url(); ?>?<?php $attachment->modified(); ?>"
alt="<?php $attachment->attachment->name(); ?>" class="typecho-attachment-photo"/></p>
<?php endif; ?>

View File

@@ -187,7 +187,11 @@ $(document).ready(function() {
cid = o.cid;
draftId = o.draftId;
idInput.val(cid);
autoSave.text('<?php _e('已保存'); ?>' + ' (' + o.time + ')').effect('highlight', 1000);
autoSave.text('<?php _e('已保存'); ?>' + ' (' + o.time + ')');
if (!$(document.body).hasClass('preview')) {
autoSave.effect('highlight', 1000);
}
cb && cb();
};

View File

@@ -187,7 +187,7 @@ class Request
}
} else {
$exists = false;
return $default;
return $value ?? $default;
}
}
@@ -545,7 +545,7 @@ class Request
$validated = true;
foreach ($params as $key => $val) {
$param = $this->get($key, null, $exists);
$validated = empty($val) ? $exists : ($val == $param);
$validated = $val === '' ? $exists : ($val === $param);
if (!$validated) {
break;

View File

@@ -224,7 +224,7 @@ class Edit extends Metas implements ActionInterface
$submit->input->setAttribute('class', 'btn primary');
$form->addItem($submit);
if (isset($this->request->mid) && 'insert' != $action) {
if ($this->request->is('mid') && 'insert' != $action) {
/** 更新模式 */
$meta = $this->db->fetchRow($this->select()
->where('mid = ?', $this->request->mid)

View File

@@ -316,7 +316,7 @@ class Upload extends Contents implements ActionInterface
'allowFeed' => 1
];
if (isset($this->request->cid)) {
if ($this->request->is('cid')) {
$cid = $this->request->filter('int')->get('cid');
if ($this->isWriteable($this->db->sql()->where('cid = ?', $cid))) {

View File

@@ -1753,7 +1753,7 @@ class XmlRpc extends Contents implements ActionInterface, Hook
throw new Exception(_t('请求的地址不存在'), 404);
}
if (isset($this->request->rsd)) {
if ($this->request->get('rsd') !== null) {
echo
<<<EOF
<?xml version="1.0" encoding="{$this->options->charset}"?>
@@ -1771,7 +1771,7 @@ class XmlRpc extends Contents implements ActionInterface, Hook
</service>
</rsd>
EOF;
} elseif (isset($this->request->wlw)) {
} elseif ($this->request->get('wlw') !== null) {
echo
<<<EOF
<?xml version="1.0" encoding="{$this->options->charset}"?>