-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11072 from jeabakker/exception-handling
security(exceptions): show admins less on exceptions
- Loading branch information
Showing
3 changed files
with
40 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
mod/developers/views/failsafe/messages/exceptions/admin_exception.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* Elgg exception (failsafe mode) | ||
* Displays a single exception | ||
* | ||
* @package Elgg | ||
* @subpackage Core | ||
* | ||
* @uses $vars['object'] An exception | ||
*/ | ||
|
||
$exception = $vars['object']; | ||
/* @var \Exception $exception */ | ||
?> | ||
|
||
<p class="elgg-messages-exception"> | ||
<span title="<?= get_class($exception); ?>"> | ||
<?= nl2br($exception->getMessage()); ?> | ||
<br /><br /> | ||
Log at time <?= $vars['ts']; ?> may have more data. | ||
</span> | ||
</p> | ||
|
||
<?php | ||
if ($exception instanceof \DatabaseException) { | ||
// likely contains credentials | ||
return; | ||
} | ||
?> | ||
|
||
<p class="elgg-messages-exception"> | ||
<?= nl2br(htmlentities(print_r($exception, true), ENT_QUOTES, 'UTF-8')); ?> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters