diff options
author | Michael Hamann <michael@content-space.de> | 2011-06-14 20:29:56 +0200 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2011-06-14 20:29:56 +0200 |
commit | 5f27cb0eab98fa6b4856278436d6aacadc4a1acb (patch) | |
tree | 800f8992da262ebc689935cb76f5658e19306252 /inc | |
parent | 1ca2719c7488662ebd7964c0d026e0890f923ee9 (diff) | |
download | rpg-5f27cb0eab98fa6b4856278436d6aacadc4a1acb.tar.gz rpg-5f27cb0eab98fa6b4856278436d6aacadc4a1acb.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.
Diffstat (limited to 'inc')
-rw-r--r-- | inc/indexer.php | 7 |
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]); |