From: Brion Vibber Date: Thu, 5 Aug 2004 06:31:42 +0000 (+0000) Subject: Fix for UTF-8 search when system locale is set to Latin-1 X-Git-Tag: 1.5.0alpha1~2513 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=882eb838b61b606e067d738a54875b6be58fd4d6;p=lhc%2Fweb%2Fwiklou.git Fix for UTF-8 search when system locale is set to Latin-1 [ 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. --- diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 252725614e..a9f20c4345 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -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 ) { diff --git a/languages/Language.php b/languages/Language.php index c7d39df336..f52ac7dbc8 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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 ) {