diff options
author | Andreas Gohr <andi@splitbrain.org> | 2010-10-27 20:53:59 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2010-10-27 20:53:59 +0200 |
commit | 55b3c9e8ad80fc80ec9ecaac33474e186cb88ee8 (patch) | |
tree | 1bf1359fee6044a704ac8465753e3c147d61e6e3 /inc/fulltext.php | |
parent | e8b9cf5ae263f3b97aaa389dddd9e7458cc0894c (diff) | |
parent | baef77a2b52933a6dd7caf3f641ff5ce6e6164f3 (diff) | |
download | rpg-55b3c9e8ad80fc80ec9ecaac33474e186cb88ee8.tar.gz rpg-55b3c9e8ad80fc80ec9ecaac33474e186cb88ee8.tar.bz2 |
Merge branch 'master' into stable
Diffstat (limited to 'inc/fulltext.php')
-rw-r--r-- | inc/fulltext.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php index 943a5d401..7ace3a724 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -229,6 +229,7 @@ function ft_pageLookup($id, $in_ns=false, $in_title=false){ } function _ft_pageLookup(&$data){ + global $conf; // split out original parameters $id = $data['id']; if (preg_match('/(?:^| )@(\w+)/', $id, $matches)) { @@ -241,6 +242,11 @@ function _ft_pageLookup(&$data){ $pages = array_map('rtrim', idx_getIndex('page', '')); $titles = array_map('rtrim', idx_getIndex('title', '')); + // check for corrupt title index #FS2076 + if(count($pages) != count($titles)){ + $titles = array_fill(0,count($pages),''); + @unlink($conf['indexdir'].'/title.idx'); // will be rebuilt in inc/init.php + } $pages = array_combine($pages, $titles); $cleaned = cleanID($id); @@ -270,7 +276,7 @@ function _ft_pageLookup(&$data){ } } - uasort($pages,'ft_pagesorter'); + uksort($pages,'ft_pagesorter'); return $pages; } |