From: Niklas Laxström Date: Fri, 22 May 2009 09:38:27 +0000 (+0000) Subject: * Unescape two entities when transforming. Motivation is to allow to use "Foo ... X-Git-Tag: 1.31.0-rc.0~41699 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=16bba5546c8a0542f8f6ba85edf9bab85b65a285;p=lhc%2Fweb%2Fwiklou.git * Unescape two entities when transforming. Motivation is to allow to use "Foo :" with escaping, like Xml::label( wfMsg('daa') ... * Escaping fix --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 2f11688511..59fcf48a27 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -646,6 +646,8 @@ function wfMsgGetKey( $key, $useDB, $langCode = false, $transform = true ) { $message = $wgMessageCache->get( $key, $useDB, $langCode ); if ( $transform ) { $message = $wgMessageCache->transform( $message ); + // Decode two entities used in messages, to allow them "pass" htmlspecialchars + $message = str_replace( array( ' ', ' ' ), array( ' ', "\xc2\xa0" ), $message ); } } else { $lang = wfGetLangObj( $langCode ); @@ -796,6 +798,8 @@ function wfMsgExt( $key, $options ) { $string = $wgMessageCache->transform( $string, !$forContent, is_object( $langCode ) ? $langCode : null ); + // Decode two entities used in messages, to allow them "pass" htmlspecialchars + $string = str_replace( array( ' ', ' ' ), array( ' ', "\xc2\xa0" ), $string ); } } @@ -1078,7 +1082,7 @@ function wfViewPrevNext( $offset, $limit, $link, $query = '', $atend = false ) { wfNumLink( $offset, 250, $title, $query ), wfNumLink( $offset, 500, $title, $query ) ) ); - return wfMsg( 'viewprevnext', $plink, $nlink, $nums ); + return wfMsgHtml( 'viewprevnext', $plink, $nlink, $nums ); } /**