Fixed Admins always get stack trace on fatal exceptions

Kirby

Well-known member
Affected version
2.2.15
PHP:
public function displayFatalExceptionMessage($e)
{
    $upgradePending = $this->hasPendingUpgrade();
    $isInstalled = \XF\Util\File::installLockExists();
    $ignorePendingUpgrade = (!$isInstalled || $this->ignorePendingUpgrade || $this->forceShowTrace);

    if (\XF::$debugMode || !$isInstalled || $this->forceShowTrace)
    {
        $showTrace = true;
    }
    else
    {
        $showTrace = false;

        try
        {
            $visitor = \XF::visitor();
            $showTrace = $visitor->user_id && $visitor->is_admin;
        }
        catch (\Throwable $e) {}
    }

This is not ideal; an admin with limited permissions can't make any sense of a stack trace and probably should not have this information at all anyway.

As XF\Error also isn't extendable this is kind of a showstopper.

Could this be changed so only super administrators (or administrator somehow specifically configured to see them) get stack traces?
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.0 Beta 3).

Change log:
Only show a stack trace resulting from a fatal exception to admins who would be able to view the error log
There may be a delay before changes are rolled out to the XenForo Community.
 

Similar threads

Back
Top Bottom