Follow-up r70109: use restore_error_handler()
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 3 Aug 2010 19:46:18 +0000 (19:46 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 3 Aug 2010 19:46:18 +0000 (19:46 +0000)
includes/Hooks.php

index 01810b2..0b2dc5f 100644 (file)
@@ -147,7 +147,7 @@ function wfRunHooks($event, $args = array()) {
                 * problem here.
                 */
                $retval = null;
-               $handler = set_error_handler( 'hookErrorHandler' );
+               set_error_handler( 'hookErrorHandler' );
                wfProfileIn( $func );
                try {
                        $retval = call_user_func_array( $callback, $hook_args );
@@ -155,11 +155,9 @@ function wfRunHooks($event, $args = array()) {
                        $badhookmsg = $e->getMessage();
                }
                wfProfileOut( $func );
-               // Need to check for null, because set_error_handler borks on it... sigh
-               if ( $handler !== null ) set_error_handler( $handler );
+               restore_error_handler();
 
                /* String return is an error; false return means stop processing. */
-
                if ( is_string( $retval ) ) {
                        global $wgOut;
                        $wgOut->showFatalError( $retval );