only
* Initial-lowercase prefix checks in namespaceDupes.php now actually work.
* Fix regression in LinkBatch.php breaking PHP 5.0
-
+* (bug 11452) wfMsgExt uses sometimes wrong language object for parsing magic
+ words when called with options ''parsemag'' or ''content''.
=== API changes in 1.12 ===
}
if( in_array('parse', $options) ) {
- $string = $wgOut->parse( $string, true, true );
+ $string = $wgOut->parse( $string, true, !$forContent );
} elseif ( in_array('parseinline', $options) ) {
- $string = $wgOut->parse( $string, true, true );
+ $string = $wgOut->parse( $string, true, !$forContent );
$m = array();
if( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
$string = $m[1];
} elseif ( in_array('parsemag', $options) ) {
global $wgMessageCache;
if ( isset( $wgMessageCache ) ) {
- $string = $wgMessageCache->transform( $string );
+ $string = $wgMessageCache->transform( $string, !$forContent );
}
}
return $message;
}
- function transform( $message ) {
+ function transform( $message, $interface = false ) {
global $wgParser;
if ( !$this->mParser && isset( $wgParser ) ) {
# Do some initialisation so that we don't have to do it twice
}
if ( !$this->mDisableTransform && $this->mParser ) {
if( strpos( $message, '{{' ) !== false ) {
- $message = $this->mParser->transformMsg( $message, $this->getParserOptions() );
+ $popts = $this->getParserOptions();
+ if ( $interface ) { $popts->setInterfaceMessage(true); }
+ $message = $this->mParser->transformMsg( $message, $popts );
+ if ( $interface ) { $popts->setInterfaceMessage(false); }
}
}
return $message;