From 2393a58ddcbe170931d69a66e7107341b1e5cf9c Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 9 Sep 2012 15:12:02 +0200 Subject: [PATCH] Don't exit too quickly when reporting an exception. MWExceptionHander::handle() already exist at the end of its task, so there's no need to have other die() calls. There were some problems with that: - wfLogProfilingData() was only called after reporting some exception - MWExceptionHandler::report() was not consistent between web and command-linerequests - MWException::reportHTML() was also not consistent when using the OutputPage object or not Also removed MWExceptionHander::escapeEchoAndDie() since it's not needed anymore. Change-Id: Ibb679c425ef0271a65f623c7b8541ec9bec70eb0 --- includes/Exception.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/includes/Exception.php b/includes/Exception.php index a131cca26e..714f73e862 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -240,7 +240,6 @@ class MWException extends Exception { } echo "\n"; - die( 1 ); } } @@ -639,7 +638,7 @@ class MWExceptionHandler { if ( $cmdLine ) { self::printError( $message ); } else { - self::escapeEchoAndDie( $message ); + echo nl2br( htmlspecialchars( $message ) ) . "\n"; } } } else { @@ -653,7 +652,7 @@ class MWExceptionHandler { if ( $cmdLine ) { self::printError( $message ); } else { - self::escapeEchoAndDie( $message ); + echo nl2br( htmlspecialchars( $message ) ) . "\n"; } } } @@ -674,17 +673,6 @@ class MWExceptionHandler { } } - /** - * Print a message after escaping it and converting newlines to
- * Use this for non-command line failures. - * - * @param $message string Failure text - */ - private static function escapeEchoAndDie( $message ) { - echo nl2br( htmlspecialchars( $message ) ) . "\n"; - die(1); - } - /** * Exception handler which simulates the appropriate catch() handling: * -- 2.20.1