mirror of
https://github.com/typecho/typecho.git
synced 2025-04-21 02:01:52 +02:00
fix request query parsing
This commit is contained in:
parent
25cc1ff3dc
commit
2fe1c0f26e
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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))) {
|
||||
|
@ -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}"?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user