diff options
-rw-r--r-- | engine/lib/elgglib.php | 15 | ||||
-rw-r--r-- | languages/en.php | 1 | ||||
-rw-r--r-- | views/failsafe/messages/exceptions/exception.php | 26 |
3 files changed, 18 insertions, 24 deletions
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 @@ ?> <p class="elgg-messages-exception"> - <span title="<?php echo get_class($vars['object']); ?>"> - <?php - - echo nl2br($vars['object']->getMessage()); - - ?> + <span title="Unrecoverable Error"> + <?php echo elgg_echo('exception:contact_admin'); ?> + <br /><br /> + Exception #<?php echo $vars['ts']; ?>. </span> </p> - -<?php - -if (elgg_get_config('debug')) { -?> - -<p class="elgg-messages-exception"> - <?php - - echo nl2br(htmlentities(print_r($vars['object'], true), ENT_QUOTES, 'UTF-8')); - - ?> -</p> -<?php - -} |