mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Search:
* show terms in quicksearch-box, when performing searches * use trim() after urldecode() to catch urlencoded whitespaces * check for empty search terms (wich occur with multiple adjacent whitespaces)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="toplinks linklist"><?php $this->brick('headerMenu'); ?></div>
|
||||
<div class="toptabs" id="toptabs"></div>
|
||||
<div class="topbar" id="topbar">
|
||||
<div class="topbar-search"><form action="."><a href="javascript:;"></a><input name="search" size="35" value="" id="livesearch-generic" /></form></div>
|
||||
<div class="topbar-search"><form action="."><a href="javascript:;"></a><input name="search" size="35" id="livesearch-generic" value="<?php echo isset($this->search) ? $this->search : ''; ?>" /></form></div>
|
||||
<div class="topbar-browse" id="topbar-browse"></div>
|
||||
<div class="topbar-buttons" id="topbar-buttons"></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user