* Unescape two entities when transforming. Motivation is to allow to use "Foo&nbsp...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Fri, 22 May 2009 09:38:27 +0000 (09:38 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Fri, 22 May 2009 09:38:27 +0000 (09:38 +0000)
* Escaping fix

includes/GlobalFunctions.php

index 2f11688..59fcf48 100644 (file)
@@ -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( '&#32;', '&nbsp;' ), 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( '&#32;', '&nbsp;' ), 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 );
 }
 
 /**