X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=015c6e81cf041d6c92ba886de1990828d6d47d74;hb=8f87d873fa04a2b175ac45421e63973102757e64;hp=6ca9e3958697cad986fcf78f78027dcec29e1aa3;hpb=1d0ac4a4812c5778c4e0c56f068d7d2b7ed24a46;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 6ca9e39586..015c6e81cf 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -23,37 +23,37 @@ require_once dirname( __FILE__ ) . '/normal/UtfNormalUtil.php'; if( !function_exists( 'iconv' ) ) { function iconv( $from, $to, $string ) { - return Fallback::fallback_iconv( $from, $to, $string ); + return Fallback::iconv( $from, $to, $string ); } } if ( !function_exists( 'mb_substr' ) ) { function mb_substr( $str, $start, $count='end' ) { - return Fallback::fallback_mb_substr( $str, $start, $count ); + return Fallback::mb_substr( $str, $start, $count ); } function mb_substr_split_unicode( $str, $splitPos ) { - return Fallback::fallback_mb_substr_split_unicode( $str, $splitPos ); + return Fallback::mb_substr_split_unicode( $str, $splitPos ); } } if ( !function_exists( 'mb_strlen' ) ) { function mb_strlen( $str, $enc = '' ) { - return Fallback::fallback_mb_strlen( $str, $enc ); + return Fallback::mb_strlen( $str, $enc ); } } if( !function_exists( 'mb_strpos' ) ) { function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) { - return Fallback::fallback_mb_strpos( $haystack, $needle, $offset, $encoding ); + return Fallback::mb_strpos( $haystack, $needle, $offset, $encoding ); } } if( !function_exists( 'mb_strrpos' ) ) { function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) { - return Fallback::fallback_mb_strrpos( $haystack, $needle, $offset, $encoding ); + return Fallback::mb_strrpos( $haystack, $needle, $offset, $encoding ); } } @@ -756,12 +756,15 @@ function wfMsgExt( $key, $options ) { if( in_array( 'content', $options, true ) ) { $forContent = true; $langCode = true; + $langCodeObj = null; } elseif( array_key_exists( 'language', $options ) ) { $forContent = false; $langCode = wfGetLangObj( $options['language'] ); + $langCodeObj = $langCode; } else { $forContent = false; $langCode = false; + $langCodeObj = null; } $string = wfMsgGetKey( $key, /*DB*/true, $langCode, /*Transform*/false ); @@ -771,9 +774,9 @@ function wfMsgExt( $key, $options ) { } if( in_array( 'parse', $options, true ) ) { - $string = $wgOut->parse( $string, true, !$forContent ); + $string = $wgOut->parse( $string, true, !$forContent, $langCodeObj ); } elseif ( in_array( 'parseinline', $options, true ) ) { - $string = $wgOut->parse( $string, true, !$forContent ); + $string = $wgOut->parse( $string, true, !$forContent, $langCodeObj ); $m = array(); if( preg_match( '/^

(.*)\n?<\/p>\n?$/sU', $string, $m ) ) { $string = $m[1]; @@ -782,8 +785,7 @@ function wfMsgExt( $key, $options ) { global $wgMessageCache; if ( isset( $wgMessageCache ) ) { $string = $wgMessageCache->transform( $string, - !$forContent, - is_object( $langCode ) ? $langCode : null ); + !$forContent, $langCodeObj ); } }