Block: Explicit convert Message to string
authorFomafix <fomafix@googlemail.com>
Thu, 20 Sep 2018 13:16:11 +0000 (15:16 +0200)
committerFomafix <fomafix@googlemail.com>
Fri, 8 Mar 2019 18:34:28 +0000 (19:34 +0100)
Without a converting method like ->parse(), ->escaped() or ->text() the
method __toString() is used which is a equivalent to ->parse().

This change switches from ->parse() to ->text() and let Html::element do
the HTML escaping, because the message 'autoblockid' is not needed to
parse.

Change-Id: I653906bdca0864989ffed5960505b96053456066

includes/Block.php

index 09f6d9f..8eac6b6 100644 (file)
@@ -1291,10 +1291,10 @@ class Block {
         */
        public function getRedactedName() {
                if ( $this->mAuto ) {
-                       return Html::rawElement(
+                       return Html::element(
                                'span',
                                [ 'class' => 'mw-autoblockid' ],
-                               wfMessage( 'autoblockid', $this->mId )
+                               wfMessage( 'autoblockid', $this->mId )->text()
                        );
                } else {
                        return htmlspecialchars( $this->getTarget() );