From: Niklas Laxström Date: Tue, 3 Aug 2010 19:46:18 +0000 (+0000) Subject: Follow-up r70109: use restore_error_handler() X-Git-Tag: 1.31.0-rc.0~35754 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=f09f99ac1f3aa11eb950fb46f2b99a4bde34844f;p=lhc%2Fweb%2Fwiklou.git Follow-up r70109: use restore_error_handler() --- diff --git a/includes/Hooks.php b/includes/Hooks.php index 01810b2b78..0b2dc5fe3c 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -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 );