Fix for UTF-8 search when system locale is set to Latin-1
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 5 Aug 2004 06:31:42 +0000 (06:31 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 5 Aug 2004 06:31:42 +0000 (06:31 +0000)
[ 961069 ] BUG and FIX: search doesn't work with some UTF-8 chars

Moves the strtolower() on the input search terms into Language::stripForSearch()
where the correct version already exists for LanguageUtf8.

includes/SearchEngine.php
languages/Language.php

index 2527256..a9f20c4 100644 (file)
@@ -305,7 +305,7 @@ class SearchEngine {
                $lc = SearchEngine::legalSearchChars() . "()";
                $q = preg_replace( "/([()])/", " \\1 ", $this->mUsertext );
                $q = preg_replace( "/\\s+/", " ", $q );
-               $w = explode( " ", strtolower( trim( $q ) ) );
+               $w = explode( " ", trim( $q ) );
 
                $last = $cond = "";
                foreach ( $w as $word ) {
index c7d39df..f52ac7d 100644 (file)
@@ -1757,7 +1757,7 @@ class Language {
                # Some languages have special punctuation to strip out
                # or characters which need to be converted for MySQL's
                # indexing to grok it correctly. Make such changes here.
-               return $in;
+               return strtolower( $in );
        }
 
        function firstChar( $s ) {