Move call of Sanitizer::decodeCharReferences from Skin to Parser
authorFomafix <fomafix@googlemail.com>
Wed, 13 Sep 2017 11:49:02 +0000 (13:49 +0200)
committerFomafix <fomafix@googlemail.com>
Wed, 13 Sep 2017 11:51:35 +0000 (13:51 +0200)
Supporting HTML entities in Wikitext is part of the parser not of the
skin.

Change-Id: Ib30ff08f4f4ce585f31211aa24b719783f06456e

includes/parser/ParserOutput.php
includes/skins/Skin.php

index 06319e5..3480a51 100644 (file)
@@ -259,7 +259,7 @@ class ParserOutput extends CacheTime {
                                        global $wgOut, $wgLang;
                                        $editsectionPage = Title::newFromText( htmlspecialchars_decode( $m[1] ) );
                                        $editsectionSection = htmlspecialchars_decode( $m[2] );
-                                       $editsectionContent = isset( $m[4] ) ? $m[3] : null;
+                                       $editsectionContent = isset( $m[4] ) ? Sanitizer::decodeCharReferences( $m[3] ) : null;
 
                                        if ( !is_object( $editsectionPage ) ) {
                                                throw new MWException( "Bad parser output text." );
index df7a9ed..f9090e1 100644 (file)
@@ -1578,8 +1578,6 @@ abstract class Skin extends ContextSource {
 
                $attribs = [];
                if ( !is_null( $tooltip ) ) {
-                       # T27462: undo double-escaping.
-                       $tooltip = Sanitizer::decodeCharReferences( $tooltip );
                        $attribs['title'] = wfMessage( 'editsectionhint' )->rawParams( $tooltip )
                                ->inLanguage( $lang )->text();
                }