From 16bba5546c8a0542f8f6ba85edf9bab85b65a285 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Fri, 22 May 2009 09:38:27 +0000 Subject: [PATCH] * Unescape two entities when transforming. Motivation is to allow to use "Foo :" with escaping, like Xml::label( wfMsg('daa') ... * Escaping fix --- includes/GlobalFunctions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ); } /** -- 2.20.1