- md5
- c8d11380f2caa0602c20ff4e2a53822f
- sha1
- 8830643e7393df62664c7f71adb79161c1fcf509
- sha256
- c71fed697447db1f53865d2502a58caf293945ba8eed5ab03b0c097cbea135ce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\CMS\Error\Renderer;
\defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Error\AbstractRenderer;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
/**
* HTML error page renderer
*
* @since 4.0
* @todo Change this renderer to use JDocumentHtml instead of JDocumentError, the latter is only used for B/C at this time
*/
class HtmlRenderer extends AbstractRenderer
{
/**
* The format (type) of the error page
*
* @var string
* @since 4.0
*/
protected $type = 'error';
/**
* Render the error page for the given object
*
* @param \Throwable $error The error object to be rendered
*
* @return string
*
* @since 4.0
*/
public function render(\Throwable $error): string
{
$app = Factory::getApplication();
// Get the current template from the application
$template = $app->getTemplate();
// Push the error object into the document
$this->getDocument()->setError($error);
if (ob_get_contents())
{
ob_end_clean();
}
$this->getDocument()->setTitle(Text::_('Error') . ': ' . $error->getCode());
return $this->getDocument()->render(
false,
[
'template' => $template,
'directory' => JPATH_THEMES,
'debug' => JDEBUG,
'csp_nonce' => $app->get('csp_nonce'),
]
);
}
}
No other release has this exact content. See every version of this file.