From f09f99ac1f3aa11eb950fb46f2b99a4bde34844f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 3 Aug 2010 19:46:18 +0000 Subject: [PATCH] Follow-up r70109: use restore_error_handler() --- includes/Hooks.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 ); -- 2.20.1