From: Brett Profitt Date: Sun, 15 Jan 2012 21:40:57 +0000 (-0800) Subject: Fixes #4036. Hiding exceptions except for admin users. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=4a3540fe36e66bee3d22795e83653140abb5deb9;p=lorea%2Felgg.git Fixes #4036. Hiding exceptions except for admin users. --- diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 9035d95f2..38ae73d82 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -995,7 +995,8 @@ function elgg_trigger_plugin_hook($hook, $type, $params = null, $returnvalue = n * @access private */ function _elgg_php_exception_handler($exception) { - error_log("*** FATAL EXCEPTION *** : " . $exception); + $timestamp = time(); + error_log("Exception #$timestamp: $exception"); // Wipe any existing output buffer ob_end_clean(); @@ -1011,7 +1012,17 @@ function _elgg_php_exception_handler($exception) { $CONFIG->pagesetupdone = true; elgg_set_viewtype('failsafe'); - $body = elgg_view("messages/exceptions/exception", array('object' => $exception)); + if (elgg_is_admin_logged_in()) { + $body = elgg_view("messages/exceptions/admin_exception", array( + 'object' => $exception, + 'ts' => $timestamp + )); + } else { + $body = elgg_view("messages/exceptions/exception", array( + 'object' => $exception, + 'ts' => $timestamp + )); + } echo elgg_view_page(elgg_echo('exception:title'), $body); } catch (Exception $e) { $timestamp = time(); diff --git a/languages/en.php b/languages/en.php index d9149a689..97867f922 100644 --- a/languages/en.php +++ b/languages/en.php @@ -37,6 +37,7 @@ $english = array( * Errors */ 'exception:title' => "Fatal Error.", + 'exception:contact_admin' => 'An unrecoverable error has occurred and has been logged. Contact the site administrator with the following information:', 'actionundefined' => "The requested action (%s) was not defined in the system.", 'actionnotfound' => "The action file for %s was not found.", diff --git a/views/failsafe/messages/exceptions/exception.php b/views/failsafe/messages/exceptions/exception.php index c35d80c87..1873ca0d9 100644 --- a/views/failsafe/messages/exceptions/exception.php +++ b/views/failsafe/messages/exceptions/exception.php @@ -12,27 +12,9 @@ ?>

- - getMessage()); - - ?> + + +

+ Exception #.

- - - -

- -

-