CoreFiles by mySites.guru
fatal.php51 lines, 1,536 bytes, from Joomla_5.3.2-Stable-Full_Package.zip
Raw History Compare with 5.3.1
md5
8113ee997f574bb060b8b19fa2d6790e
sha1
3540726fad97e6fb561a44dcfd81a737888d918b
sha256
991f7f0b7a946a24698b0cef676a326a5417c69cfc1d593d557d8e1847d2eb73
<?php

/**
 * @package     Joomla.Site
 * @subpackage  Template.system
 *
 * @copyright   (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

\defined('_JEXEC') or die;

use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;

/**
 * Note: This file is only used when unrecoverable errors happen,
 * normally at boot up stages, and therefore it cannot be assumed
 * that any part of Joomla is available (Eg: a Factory or application)
 *
 * For "normal" error handling, use error.php not this file.
 *
 * @var  HtmlErrorRenderer  $this       object containing charset
 * @var  string             $statusText exception error message
 * @var  string             $statusCode exception error code
 */

// Fallback template
$template = '{{statusCode_statusText}}';

// Joomla supplied fatal error page
if (file_exists(__DIR__ . '/fatal-error.html')) {
    $template = file_get_contents(__DIR__ . '/fatal-error.html');
}

/**
 * User supplied fatal error page.
 *
 * Allow overriding Joomla supplied page to prevent changes being wiped on Joomla upgrade.
 * We allow it to be a PHP file so that any post-processing, alerting etc can happen.
 */
if (file_exists(__DIR__ . '/fatal-error.custom.php')) {
    require __DIR__ . '/fatal-error.custom.php';

    return;
}

echo str_replace(
    ['{{statusCode_statusText}}', '{{statusCode}}', '{{statusText}}'],
    [$statusCode . ' - ' . $statusText, $statusCode, $statusText],
    $template
);

The same content is in 148 releases, Joomla 5.0.0-rc to 6.2.1-rc1. See them all, or every version of this file.