summaryrefslogtreecommitdiff
path: root/inc/fulltext.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2010-10-24 10:08:30 +0200
committerAndreas Gohr <andi@splitbrain.org>2010-10-24 10:08:30 +0200
commit4987233dfc97c0b3bdfa620a25fc3ee5775f42a5 (patch)
treef2853e9fd4042ff8340766ba1da1465bb7015e69 /inc/fulltext.php
parent24650a1909022a24959489f1508fd877ce6db576 (diff)
downloadrpg-4987233dfc97c0b3bdfa620a25fc3ee5775f42a5.tar.gz
rpg-4987233dfc97c0b3bdfa620a25fc3ee5775f42a5.tar.bz2
detect corrupt title indexes FS#2076
Diffstat (limited to 'inc/fulltext.php')
-rw-r--r--inc/fulltext.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php
index 943a5d401..8cdfac42e 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -241,6 +241,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);