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

Change subject: Pass arguments to ParserAfterParse by reference
......................................................................


Pass arguments to ParserAfterParse by reference

The workaround to save PNG images calls the hook wrong,
the parameters must be passed as references.

Bug: T105598
Change-Id: Ic77aa79aa6e2bf2a9ec00be4cc775d0123bed91a
---
M MathTexvc.php
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, but someone else must approve
  Jforrester: Looks good to me, approved
  Physikerwelt: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/MathTexvc.php b/MathTexvc.php
index f4d26e3..d18702c 100644
--- a/MathTexvc.php
+++ b/MathTexvc.php
@@ -407,7 +407,10 @@
                // Workaround for bugfix for Bug 56769
                if ( !isset( $wgHooks['ParserAfterParse']['FlushMathBackend'] ) 
) {
                        // saves the PNG-file
-                       Hooks::run( 'ParserAfterParse', array( new Parser(), 
'', new StripState( '' ) ) );
+                       $parser = new Parser();
+                       $text = '';
+                       $stripState = new StripState( '' );
+                       Hooks::run( 'ParserAfterParse', array( &$parser, 
&$text, &$stripState ) );
                }
                $backend = $this->getBackend();
                return $backend->getFileContents( array( 'src' => 
$this->getHashPath() . "/" . $this->getHash() . '.png' ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic77aa79aa6e2bf2a9ec00be4cc775d0123bed91a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Physikerwelt <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to