We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab8edd1 commit fbc2426Copy full SHA for fbc2426
libraries/src/Error/Renderer/XmlRenderer.php
@@ -9,7 +9,9 @@
9
10
namespace Joomla\CMS\Error\Renderer;
11
12
+use Joomla\Application\WebApplicationInterface;
13
use Joomla\CMS\Error\AbstractRenderer;
14
+use Joomla\CMS\Factory;
15
16
// phpcs:disable PSR1.Files.SideEffects
17
\defined('_JEXEC') or die;
@@ -61,6 +63,12 @@ public function render(\Throwable $error): string
61
63
// End error element
62
64
$xw->endElement();
65
66
+ $app = Factory::getApplication();
67
+
68
+ if ($app instanceof WebApplicationInterface) {
69
+ $app->setHeader('status', $error->getCode() < 400 ? 500 : $error->getCode());
70
+ }
71
72
// Push the data object into the document
73
$this->getDocument()->setBuffer($xw->outputMemory(true));
74
0 commit comments