jenkins-bot has submitted this change and it was merged. Change subject: Parse error messages ......................................................................
Parse error messages Error messages can contain wikitext, so should be parsed. E.g. https://www.mediawiki.org/wiki/MediaWiki:Abusefilter-disallowed Without parsing the error message, this results in: [[Image:Stop x nuvola.svg|50px|link=]] This action has been automatically identified as harmful, and has been '''disallowed.''' If you believe your edit was constructive, please inform an [[Project:Administrators|administrator]] of what you were trying to do. A brief description of the abuse rule which your action matched is: Change-Id: If8fa1fdb35a4b99e1ed60985b4318ffc9bedb5f9 --- M includes/api/ApiFlow.php M templates/edit-header.html.php M templates/edit-post.html.php M templates/edit-title.html.php M templates/header.html.php M templates/post.html.php M templates/topiclist.html.php 7 files changed, 8 insertions(+), 8 deletions(-) Approvals: EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/api/ApiFlow.php b/includes/api/ApiFlow.php index 53c23e5..5a2fb59 100644 --- a/includes/api/ApiFlow.php +++ b/includes/api/ApiFlow.php @@ -89,7 +89,7 @@ $nativeErrors = array(); foreach( $errors as $key ) { - $nativeErrors[$key]['message'] = $block->getErrorMessage( $key )->plain(); + $nativeErrors[$key]['message'] = $block->getErrorMessage( $key )->parse(); $nativeErrors[$key]['extra'] = $block->getErrorExtra( $key ); } diff --git a/templates/edit-header.html.php b/templates/edit-header.html.php index e6096a4..5c3f533 100644 --- a/templates/edit-header.html.php +++ b/templates/edit-header.html.php @@ -15,7 +15,7 @@ if ( $block->hasErrors() ) { echo '<ul>'; foreach ( $block->getErrors() as $error ) { - echo '<li>', $block->getErrorMessage( $error )->escaped() . '</li>'; + echo '<li>', $block->getErrorMessage( $error )->parse() . '</li>'; } echo '</ul>'; } diff --git a/templates/edit-post.html.php b/templates/edit-post.html.php index e166c56..67e3248 100644 --- a/templates/edit-post.html.php +++ b/templates/edit-post.html.php @@ -16,7 +16,7 @@ if ( $block->hasErrors() ) { echo '<ul>'; foreach ( $block->getErrors() as $error ) { - echo '<li>', $block->getErrorMessage( $error )->escaped() . '</li>'; + echo '<li>', $block->getErrorMessage( $error )->parse() . '</li>'; } echo '</ul>'; } diff --git a/templates/edit-title.html.php b/templates/edit-title.html.php index 0883108..ab39821 100644 --- a/templates/edit-title.html.php +++ b/templates/edit-title.html.php @@ -14,7 +14,7 @@ if ( $block->hasErrors() ) { echo '<ul>'; foreach ( $block->getErrors() as $error ) { - echo '<li>', $block->getErrorMessage( $error )->escaped() . '</li>'; + echo '<li>', $block->getErrorMessage( $error )->parse() . '</li>'; } echo '</ul>'; } diff --git a/templates/header.html.php b/templates/header.html.php index f43e028..4e6721b 100644 --- a/templates/header.html.php +++ b/templates/header.html.php @@ -11,7 +11,7 @@ echo Html::element( 'p', array( 'id' => 'flow-header-error' ), - $block->getErrorMessage( 'content' )->text() + $block->getErrorMessage( 'content' )->parse() ); } diff --git a/templates/post.html.php b/templates/post.html.php index b47f7d3..aabd8db 100644 --- a/templates/post.html.php +++ b/templates/post.html.php @@ -24,7 +24,7 @@ if ( $block->getHexRepliedTo() === $post->getPostId()->getHex() ) { $replyForm .= '<ul>'; foreach ( $block->getErrors() as $error ) { - $replyForm .= '<li>' . $block->getErrorMessage( $error )->escaped() . '</li>'; + $replyForm .= '<li>' . $block->getErrorMessage( $error )->parse() . '</li>'; } $replyForm .= '</ul>'; } diff --git a/templates/topiclist.html.php b/templates/topiclist.html.php index e63ef44..cf0cfd8 100644 --- a/templates/topiclist.html.php +++ b/templates/topiclist.html.php @@ -10,7 +10,7 @@ echo Html::element( 'input', array( 'type' => 'hidden', 'name' => 'wpEditToken', 'value' => $editToken) ); if ( $block->hasErrors( 'topic' ) ) { - echo '<p>' . $block->getErrorMessage( 'topic' )->escaped() . '</p>'; + echo '<p>' . $block->getErrorMessage( 'topic' )->parse() . '</p>'; } echo Html::input( $block->getName() . '[topic]', '', 'text', array( @@ -21,7 +21,7 @@ ); if ( $block->hasErrors( 'content' ) ) { - echo '<p>' . $block->getErrorMessage( 'content' )->escaped() . '</p>'; + echo '<p>' . $block->getErrorMessage( 'content' )->parse() . '</p>'; } echo Html::textarea( $block->getName() . '[content]', '', array( 'placeholder' => wfMessage( 'flow-newtopic-content-placeholder' )->text(), -- To view, visit https://gerrit.wikimedia.org/r/106690 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If8fa1fdb35a4b99e1ed60985b4318ffc9bedb5f9 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Matthias Mullie <[email protected]> Gerrit-Reviewer: EBernhardson <[email protected]> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
