aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/fulltext.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/fulltext.php')
-rw-r--r--inc/fulltext.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php
index 79b2c4f8a..7c28a5962 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -80,7 +80,9 @@ function _ft_pageSearch(&$data) {
case 'W-:':
case 'W_:': // word
$word = substr($token, 3);
- $stack[] = (array) $lookup[$word];
+ if(isset($lookup[$word])) {
+ $stack[] = (array)$lookup[$word];
+ }
break;
case 'P+:':
case 'P-:': // phrase
@@ -266,6 +268,10 @@ function _ft_pageLookup(&$data){
$ns = cleanID($parsedQuery['ns'][0]) . ':';
$id = implode(' ', $parsedQuery['highlight']);
}
+ if (count($parsedQuery['notns']) > 0) {
+ $notns = cleanID($parsedQuery['notns'][0]) . ':';
+ $id = implode(' ', $parsedQuery['highlight']);
+ }
$in_ns = $data['in_ns'];
$in_title = $data['in_title'];
@@ -297,6 +303,13 @@ function _ft_pageLookup(&$data){
}
}
}
+ if (isset($notns)) {
+ foreach (array_keys($pages) as $p_id) {
+ if (strpos($p_id, $notns) === 0) {
+ unset($pages[$p_id]);
+ }
+ }
+ }
// discard hidden pages
// discard nonexistent pages