From 4987233dfc97c0b3bdfa620a25fc3ee5775f42a5 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 24 Oct 2010 10:08:30 +0200 Subject: detect corrupt title indexes FS#2076 --- inc/fulltext.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'inc/fulltext.php') 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); -- cgit v1.2.3 From 7f97a9005507f048c61d44adc6ca954fcb884541 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 24 Oct 2010 12:27:01 +0200 Subject: fixed missing global --- inc/fulltext.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc/fulltext.php') diff --git a/inc/fulltext.php b/inc/fulltext.php index 8cdfac42e..0b9798eee 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)) { -- cgit v1.2.3 From 3d2017d9ca9f1e056a33fea3dd482747e901409f Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Sun, 24 Oct 2010 20:31:23 +0200 Subject: Fix sorting of quicksearch results --- inc/fulltext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/fulltext.php') diff --git a/inc/fulltext.php b/inc/fulltext.php index 0b9798eee..7ace3a724 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -276,7 +276,7 @@ function _ft_pageLookup(&$data){ } } - uasort($pages,'ft_pagesorter'); + uksort($pages,'ft_pagesorter'); return $pages; } -- cgit v1.2.3