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 );
}
}
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 );
}
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( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
$string = $m[1];
global $wgMessageCache;
if ( isset( $wgMessageCache ) ) {
$string = $wgMessageCache->transform( $string,
- !$forContent,
- is_object( $langCode ) ? $langCode : null );
+ !$forContent, $langCodeObj );
}
}