jenkins-bot has submitted this change and it was merged.

Change subject: Do not transform message of TPException as work around for php 
bug
......................................................................


Do not transform message of TPException as work around for php bug

Due to a complicated tangle of various events coming together that
triggers an obscure PHP bug, calling ->text() on the message
causes the Parser to throw extensions related to invalid marker.
See the bug for details.

This should really be fixed properly somehow in the Parser, but
I'm not quite sure how to do that cleanly. In any case, it doesn't
hurt to fix it here too. Even once this is fixed in core, we
would want this extension to not have the bug if used with
old versions of MediaWiki

This would only change things (afaict) if a TPException is
thrown which is uncaught (usually they're caught). Furthermore, it
really shouldn't affect anything as it's unlikely those messages
would have {{VARIABLES}} to expand.

Bug: 56226
Change-Id: Ifd16c7c8ec6753ea4c74e6a9100e9d147ca915e9
---
M tag/TPException.php
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Nikerabbit: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tag/TPException.php b/tag/TPException.php
index ea563af..c08a1f5 100644
--- a/tag/TPException.php
+++ b/tag/TPException.php
@@ -22,7 +22,8 @@
         */
        public function __construct( array $msg ) {
                $this->msg = $msg;
-               $wikitext = call_user_func_array( 'wfMessage', $msg )->text();
+               // Using ->plain() instead of ->text() due to bug 56226
+               $wikitext = call_user_func_array( 'wfMessage', $msg )->plain();
                parent::__construct( $wikitext );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/94098
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd16c7c8ec6753ea4c74e6a9100e9d147ca915e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to