Fix regression from r26893: a few messages that formerly accepted character entities...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 30 Nov 2007 18:03:29 +0000 (18:03 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 30 Nov 2007 18:03:29 +0000 (18:03 +0000)
includes/GlobalFunctions.php
includes/Skin.php

index 02b4eab..26bf20b 100644 (file)
@@ -546,10 +546,12 @@ function wfMsgWikiHtml( $key ) {
  * @param array $options Processing rules:
  *  <i>parse</i>: parses wikitext to html
  *  <i>parseinline</i>: parses wikitext to html and removes the surrounding p's added by parser or tidy
- *  <i>escape</i>: filters message trough htmlspecialchars
+ *  <i>escape</i>: filters message through htmlspecialchars
+ *  <i>escapenoentities</i>: same, but allows entity references like &nbsp; through
  *  <i>replaceafter</i>: parameters are substituted after parsing or escaping
  *  <i>parsemag</i>: transform the message using magic phrases
  *  <i>content</i>: fetch message for content language instead of interface
+ * Behavior for conflicting options (e.g., parse+parseinline) is undefined.
  */
 function wfMsgExt( $key, $options ) {
        global $wgOut, $wgParser;
@@ -590,6 +592,8 @@ function wfMsgExt( $key, $options ) {
 
        if ( in_array('escape', $options) ) {
                $string = htmlspecialchars ( $string );
+       } elseif ( in_array( 'escapenoentities', $options ) ) {
+               $string = str_replace( '&amp;', '&', htmlspecialchars( $string ) );
        }
 
        if( in_array('replaceafter', $options) ) {
index e4769d5..a9b91e7 100644 (file)
@@ -1226,7 +1226,7 @@ END;
                        // language (which may or may not be the same as the default language),
                        // but we make the link target be the one site-wide page.
                        return $this->makeKnownLink( wfMsgForContent( $page ),
-                               wfMsgExt( $desc, array( 'parsemag', 'escape' ) ) );
+                               wfMsgExt( $desc, array( 'parsemag', 'escapenoentities' ) ) );
                }
        }
 
@@ -1659,4 +1659,4 @@ END;
                return $bar;
        }
        
-}
\ No newline at end of file
+}