summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-11-24 22:54:13 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-11-24 22:54:13 +0100
commit6798a86a10e58a8c235f7c405c016d56353dc030 (patch)
tree670cd4258fa42bb32015c236ddb377a12ae1f6b7 /inc
parente9208eb1391a5ee473590be354dd6a117b9fcd1f (diff)
downloadrpg-6798a86a10e58a8c235f7c405c016d56353dc030.tar.gz
rpg-6798a86a10e58a8c235f7c405c016d56353dc030.tar.bz2
trim pagename returned by ft_pageLookup
darcs-hash:20061124215413-7ad00-f2bd46b7edf70660cc3e0274bd222eafba1edbc6.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/fulltext.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php
index 1534ec1a8..f2f071fc5 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -150,7 +150,7 @@ function ft_pageLookup($id,$pageonly=true){
global $conf;
$id = preg_quote($id,'/');
$pages = file($conf['indexdir'].'/page.idx');
- $pages = array_values(preg_grep('/'.$id.'/',$pages));
+ if($id) $pages = array_values(preg_grep('/'.$id.'/',$pages));
$cnt = count($pages);
for($i=0; $i<$cnt; $i++){
@@ -176,6 +176,7 @@ function ft_pageLookup($id,$pageonly=true){
}
}
+ $pages = array_map('trim',$pages);
sort($pages);
return $pages;
}