diff options
Diffstat (limited to 'inc/fulltext.php')
-rw-r--r-- | inc/fulltext.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php index 1c9981812..cac2de4a4 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -243,17 +243,21 @@ function _ft_pageLookup(&$data){ $titles = array_map('rtrim', idx_getIndex('title', '')); $pages = array_combine($pages, $titles); - if($id !== '' && cleanID($id) !== '') { + if ($id !== '' && cleanID($id) !== '') { $cleaned = cleanID($id); - $matched_pages = array(); foreach ($pages as $p_id => $p_title) { - if (((strpos($in_ns ? $p_id : noNSorNS($p_id), $cleaned) !== false) || - ($in_title && stripos($p_title, $id) !== false)) && - (!isset($ns) || strpos($p_id, $ns) === 0)) { - $matched_pages[$p_id] = $p_title; + if ((strpos($in_ns ? $p_id : noNSorNS($p_id), $cleaned) === false) && + ($in_title && stripos($p_title, $id) === false)) { + unset($pages[$p_id]); + } + } + } + if (isset($ns)) { + foreach (array_keys($pages) as $p_id) { + if (strpos($p_id, $ns) !== 0) { + unset($pages[$p_id]); } } - $pages = $matched_pages; } // discard hidden pages |