r50883 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50882‎ | r50883 | r50884 >
Date:09:38, 22 May 2009
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
* Unescape two entities when transforming. Motivation is to allow to use "Foo :" with escaping, like Xml::label( wfMsg('daa') ...
* Escaping fix
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -646,6 +646,8 @@
647647 $message = $wgMessageCache->get( $key, $useDB, $langCode );
648648 if ( $transform ) {
649649 $message = $wgMessageCache->transform( $message );
 650+ // Decode two entities used in messages, to allow them "pass" htmlspecialchars
 651+ $message = str_replace( array( ' ', ' ' ), array( ' ', "\xc2\xa0" ), $message );
650652 }
651653 } else {
652654 $lang = wfGetLangObj( $langCode );
@@ -796,6 +798,8 @@
797799 $string = $wgMessageCache->transform( $string,
798800 !$forContent,
799801 is_object( $langCode ) ? $langCode : null );
 802+ // Decode two entities used in messages, to allow them "pass" htmlspecialchars
 803+ $string = str_replace( array( ' ', ' ' ), array( ' ', "\xc2\xa0" ), $string );
800804 }
801805 }
802806
@@ -1078,7 +1082,7 @@
10791083 wfNumLink( $offset, 250, $title, $query ),
10801084 wfNumLink( $offset, 500, $title, $query )
10811085 ) );
1082 - return wfMsg( 'viewprevnext', $plink, $nlink, $nums );
 1086+ return wfMsgHtml( 'viewprevnext', $plink, $nlink, $nums );
10831087 }
10841088
10851089 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r51456Revert part of r50883, superseded by Tim's r51453nikerabbit07:38, 4 June 2009

Comments

#Comment by Simetrical (talk | contribs)   00:47, 28 May 2009

This is a much nicer solution than escapenoentities. Maybe we should get rid of that now? It seems counterproductive with this fix in place.

#Comment by Nikerabbit (talk | contribs)   10:24, 28 May 2009

Yes. If this solution is acceptable for everybody we can start removing escapenoentities from use.

Status & tagging log