diff --git a/MathTexvc.php b/MathTexvc.php index 70f351c..b1e9662 100644 --- a/MathTexvc.php +++ b/MathTexvc.php @@ -401,7 +401,13 @@ class MathTexvc extends MathRenderer { } return false; } + public function getPng() { + // Workaround for bugfix for Bug 56769 + if ( !isset( $wgHooks['ParserAfterParse']['FlushMathBackend'] ) ) { + // saves the PNG-file + Hooks::run( 'ParserAfterParse' ); + } $backend = $this->getBackend(); return $backend->getFileContents( array( 'src' => $this->getHashPath() . "/" . $this->getHash() . '.png' ) ); } diff --git a/SpecialMathShowImage.php b/SpecialMathShowImage.php index 7b5fda1..3b57c40 100644 --- a/SpecialMathShowImage.php +++ b/SpecialMathShowImage.php @@ -93,11 +93,6 @@ class SpecialMathShowImage extends SpecialPage { } if ( $success ) { if ( $this->mode == MW_MATH_PNG ) { - // Workaround for bugfix for Bug 56769 - if ( !isset( $wgHooks['ParserAfterParse']['FlushMathBackend'] ) ) { - // saves the PNG-file - wfRunHooks('ParserAfterParse'); - } $output = $this->renderer->getPng(); } else { $output = $this->renderer->getSvg();