diff options
author | Hakan Sandell <sandell.hakan@gmail.com> | 2010-11-13 15:29:49 +0100 |
---|---|---|
committer | Hakan Sandell <sandell.hakan@gmail.com> | 2010-11-13 15:29:49 +0100 |
commit | 14928129ac979d50664cff367377db5364f8e663 (patch) | |
tree | c244ebec8400361b7f084503f3ae40b2142647d5 /inc/fulltext.php | |
parent | bcb79ff3b3b63c74a93cdf4762fa0cd1bb28d17a (diff) | |
parent | ebb29737d32bc331541f78a1a47f33ba33919938 (diff) | |
download | rpg-14928129ac979d50664cff367377db5364f8e663.tar.gz rpg-14928129ac979d50664cff367377db5364f8e663.tar.bz2 |
Merge branch 'master' of git://github.com/splitbrain/dokuwiki
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; } |