Update Hook call

* Replace deprecated wfHooksRun with Hooks::run
* move texvc specific bugfix to texvc class

Change-Id: Iba2aff9205ebbb39e256396072282e2ed96cc4b0
This commit is contained in:
physikerwelt 2015-04-17 09:26:20 -04:00 committed by Physikerwelt
parent b6adfb56f4
commit 1cd0dad54f
2 changed files with 6 additions and 5 deletions

View File

@ -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' ) );
}

View File

@ -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();