Whitespace/style consistency
[mediawiki.git] / languages / classes / LanguageZh_hans.php
blob983dd485802a7dd0590245fa520a17a843952929
1 <?php
3 /**
4 * @ingroup Language
5 */
6 class LanguageZh_hans extends Language {
7 function stripForSearch( $string ) {
8 # MySQL fulltext index doesn't grok utf-8, so we
9 # need to fold cases and convert to hex
10 # we also separate characters as "words"
11 if( function_exists( 'mb_strtolower' ) ) {
12 return preg_replace(
13 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
14 "' U8' . bin2hex( \"$1\" )",
15 mb_strtolower( $string ) );
16 } else {
17 list( , $wikiLowerChars ) = Language::getCaseMaps();
18 return preg_replace(
19 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
20 "' U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )",
21 $string );