From: Alexandre Emsenhuber Date: Sun, 9 Sep 2012 13:12:02 +0000 (+0200) Subject: Don't exit too quickly when reporting an exception. X-Git-Tag: 1.31.0-rc.0~22413^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=2393a58ddcbe170931d69a66e7107341b1e5cf9c;p=lhc%2Fweb%2Fwiklou.git 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 --- 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: *