summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2011-06-14 20:29:56 +0200
committerAndreas Gohr <andi@splitbrain.org>2011-06-14 21:29:26 +0200
commit458dd6e829124891f9998c30b061131c67b86ac4 (patch)
tree8cf3d1b3d4f17feadbab43fbdd7c2a0dcbb847d5
parent781f882889517a892f5b7b6108e6f334f646301a (diff)
downloadrpg-458dd6e829124891f9998c30b061131c67b86ac4.tar.gz
rpg-458dd6e829124891f9998c30b061131c67b86ac4.tar.bz2
Fix lowercasing of words in the indexer FS#2270
On certain PHP installations (it has been reproduced with PHP version 5.2.0-8+etch11) the indexer failed to lowercase words in the indexer so the fulltext search was partially broken.
-rw-r--r--inc/indexer.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/inc/indexer.php b/inc/indexer.php
index 1f0094876..546b2a288 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -444,9 +444,12 @@ class Doku_Indexer {
$text = utf8_stripspecials($text, ' ', '\._\-:'.$wc);
$wordlist = explode(' ', $text);
- foreach ($wordlist as $i => &$word) {
- $word = (preg_match('/[^0-9A-Za-z]/u', $word)) ?
+ foreach ($wordlist as $i => $word) {
+ $wordlist[$i] = (preg_match('/[^0-9A-Za-z]/u', $word)) ?
utf8_strtolower($word) : strtolower($word);
+ }
+
+ foreach ($wordlist as $i => $word) {
if ((!is_numeric($word) && strlen($word) < IDX_MINWORDLENGTH)
|| array_search($word, $stopwords) !== false)
unset($wordlist[$i]);