SECURITY: Avoid double-escaping html tag contents

* Avoid double-escaping the captcha-edit-fail message
via both Html::element and RawMessage.

* Also add suppress comment due to overall taint of
RawMessage.

Bug: T293818
Change-Id: I6b985266a26f6b152bca05a91f6054ed1a5f2a5a
(cherry picked from commit 1493c928c2)
This commit is contained in:
sbassett 2021-10-25 10:19:07 -05:00 committed by SBassett
parent d0995dcef7
commit f1ba778dc9

View file

@ -876,8 +876,10 @@ class SimpleCaptcha {
// for the user, which we don't know, when he did it.
if ( $this->action === 'edit' ) {
$status->fatal(
// T293818 - only worried about $content here
// @phan-suppress-next-line SecurityCheck-DoubleEscaped
new RawMessage(
Html::element(
Html::rawElement(
'div',
[ 'class' => 'errorbox' ],
$context->msg( 'captcha-edit-fail' )->text()