From 0c074a526c832cbb5f44e7c8f0a22d174ac3008f Mon Sep 17 00:00:00 2001
From: Michael Hamann <michael@content-space.de>
Date: Fri, 22 Apr 2011 09:51:35 +0200
Subject: [PATCH] Make ft_pageLookup respect the namespace restriction again

Before this change all pages of the given namespace have been included
in the result, now the search is restricted to the namespace again as it
was before the new indexer has been implemented.
---
 inc/fulltext.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/inc/fulltext.php b/inc/fulltext.php
index 8155325ee..d2fbabe77 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -241,11 +241,11 @@ function _ft_pageLookup(&$data){
             }
         }
     }
+
     if (isset($ns)) {
-        foreach ($page_idx as $p_id) {
-            if (strpos($p_id, $ns) === 0) {
-                if (!isset($pages[$p_id]))
-                    $pages[$p_id] = p_get_first_heading($p_id, false);
+        foreach (array_keys($pages) as $p_id) {
+            if (strpos($p_id, $ns) !== 0) {
+                unset($pages[$p_id]);
             }
         }
     }
-- 
GitLab