diff --git a/pages/search.php b/pages/search.php index 89ba315d..2f95eaaa 100644 --- a/pages/search.php +++ b/pages/search.php @@ -56,7 +56,7 @@ class SearchPage extends GenericPage public function __construct($pageCall, $pageParam) { - $this->search = urlDecode(trim($pageParam)); + $this->search = trim(urlDecode($pageParam)); $this->query = strtr($this->search, '?*', '_%'); // restricted access @@ -117,10 +117,11 @@ class SearchPage extends GenericPage if (!$this->query) return; - $parts = explode(' ', $this->query); - foreach ($parts as $p) + foreach (explode(' ', $this->query) as $p) { - if ($p[0] == '-') + if (!$p) // multiple spaces + continue; + else if ($p[0] == '-') { if (strlen($p) < 4) $this->invalid[] = substr($p, 1); diff --git a/template/bricks/header.tpl.php b/template/bricks/header.tpl.php index 3a9b45a9..64c2a12d 100644 --- a/template/bricks/header.tpl.php +++ b/template/bricks/header.tpl.php @@ -18,7 +18,7 @@
- +