* fix loophole.

This commit is contained in:
王怡栋
2021-10-08 10:35:38 +08:00
parent a14fc4e7f9
commit 88a5c5d207
2 changed files with 19 additions and 2 deletions
+1 -1
View File
@@ -691,7 +691,7 @@ class commonModel extends model
}
/* Fix bug 14574. */
if(array_slice($items, -1)[0] == 'divider') array_pop($items);
if(end($items) == 'divider') array_pop($items);
return $items;
}
+18 -1
View File
@@ -70,7 +70,24 @@ class search extends control
public function buildQuery()
{
$this->search->buildQuery();
die(js::locate($this->post->actionURL, 'parent'));
$actionURL = $this->post->actionURL;
$parsedURL = parse_url($actionURL);
if(isset($parsedURL['host'])) die();
if($this->config->requestType != 'GET')
{
$path = $parsedURL['path'];
$path = str_replace($this->config->webRoot, '', $path);
if(strpos($path, '.') !== false) $path = substr($path, 0, strpos($path, '.'));
if(preg_match("/^\w+{$this->config->requestFix}\w+/", $path) == 0) die();
}
else
{
$query = $parsedURL['query'];
if(preg_match("/^{$this->config->moduleVar}=\w+\&{$this->config->methodVar}=\w+/", $query) == 0) die();
}
die(js::locate($actionURL, 'parent'));
}
/**