r70406 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70405‎ | r70406 | r70407 >
Date:19:46, 3 August 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Follow-up r70109: use restore_error_handler()
Modified paths:
  • /trunk/phase3/includes/Hooks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Hooks.php
@@ -147,7 +147,7 @@
148148 * problem here.
149149 */
150150 $retval = null;
151 - $handler = set_error_handler( 'hookErrorHandler' );
 151+ set_error_handler( 'hookErrorHandler' );
152152 wfProfileIn( $func );
153153 try {
154154 $retval = call_user_func_array( $callback, $hook_args );
@@ -155,11 +155,9 @@
156156 $badhookmsg = $e->getMessage();
157157 }
158158 wfProfileOut( $func );
159 - // Need to check for null, because set_error_handler borks on it... sigh
160 - if ( $handler !== null ) set_error_handler( $handler );
 159+ restore_error_handler();
161160
162161 /* String return is an error; false return means stop processing. */
163 -
164162 if ( is_string( $retval ) ) {
165163 global $wgOut;
166164 $wgOut->showFatalError( $retval );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70109Better error message if hook function signature does not match parameters....nikerabbit21:05, 28 July 2010

Status & tagging log