Don't double escape html entities for messages obtained through Message::escaped().
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 23 Apr 2011 16:27:29 +0000 (16:27 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 23 Apr 2011 16:27:29 +0000 (16:27 +0000)
Since we require PHP 5.2.3+ and htmlspecialchars() has a fourth parameter to prevent double escaping since... PHP 5.2.3 (per manual), let's use it

includes/Message.php

index 8097d43..16af726 100644 (file)
@@ -278,9 +278,8 @@ class Message {
                } elseif( $this->format === 'text' ){
                        $string = $this->transformText( $string );
                } elseif( $this->format === 'escaped' ){
-                       # FIXME: Sanitizer method here?
                        $string = $this->transformText( $string );
-                       $string = htmlspecialchars( $string );
+                       $string = htmlspecialchars( $string, ENT_QUOTES, 'UTF-8', false );
                }
                
                # Raw parameter replacement