aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-01-15 13:40:57 -0800
committerBrett Profitt <brett.profitt@gmail.com>2012-01-15 13:40:57 -0800
commit4a3540fe36e66bee3d22795e83653140abb5deb9 (patch)
treeba2d3c65995b8bba0aaaf41545d2905e03b70969 /engine/lib/elgglib.php
parent68e4829ac0959d86c651e7ed6dc255c39694c8af (diff)
downloadelgg-4a3540fe36e66bee3d22795e83653140abb5deb9.tar.gz
elgg-4a3540fe36e66bee3d22795e83653140abb5deb9.tar.bz2
Fixes #4036. Hiding exceptions except for admin users.
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php15
1 files changed, 13 insertions, 2 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();