From: Fomafix Date: Wed, 13 Sep 2017 11:49:02 +0000 (+0200) Subject: Move call of Sanitizer::decodeCharReferences from Skin to Parser X-Git-Tag: 1.31.0-rc.0~2114^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=396f2684b83b67d11f0fda45fd9c14b1ea4d9d10 Move call of Sanitizer::decodeCharReferences from Skin to Parser Supporting HTML entities in Wikitext is part of the parser not of the skin. Change-Id: Ib30ff08f4f4ce585f31211aa24b719783f06456e --- diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 06319e5575..3480a51f3c 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -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." ); diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index df7a9edede..f9090e1361 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -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(); }