$hashpath = $this->_getHashPath();
if( !file_exists( $hashpath ) ) {
- if( !@wfMkdirParents( $hashpath, 0755 ) ) {
+ wfSuppressWarnings();
+ $ret = wfMkdirParents( $hashpath, 0755 );
+ wfRestoreWarnings();
+ if( !$ret ) {
return $this->_error( 'math_bad_output' );
}
} elseif( !is_dir( $hashpath ) || !is_writable( $hashpath ) ) {
if( file_exists( $filename ) ) {
if( filesize( $filename ) == 0 ) {
// Some horrible error corrupted stuff :(
- @unlink( $filename );
+ wfSuppressWarnings();
+ unlink( $filename );
+ wfRestoreWarnings();
} else {
return true;
}
$hashpath = $this->_getHashPath();
if( !file_exists( $hashpath ) ) {
- if( !@wfMkdirParents( $hashpath, 0755 ) ) {
+ wfSuppressWarnings();
+ $ret = wfMkdirParents( $hashpath, 0755 );
+ wfRestoreWarnings();
+ if( !$ret ) {
return false;
}
} elseif( !is_dir( $hashpath ) || !is_writable( $hashpath ) ) {
.'/'. substr($this->hash, 2, 1);
}
- public static function renderMath( $tex, $params=array() ) {
- global $wgUser;
+ public static function renderMath( $tex, $params=array(), ParserOptions $parserOptions = null ) {
$math = new MathRenderer( $tex, $params );
- $math->setOutputMode( $wgUser->getOption('math'));
+ if ( $parserOptions )
+ $math->setOutputMode( $parserOptions->getMath() );
return $math->render();
}
}