This commit is contained in:
2026-02-02 23:53:44 +01:00
parent d5ecbed2db
commit 27eb48b32f
2 changed files with 16 additions and 3 deletions

View File

@@ -4870,9 +4870,22 @@ SQL;
private function ensureDebugEnv(): void
{
$env = strtolower((string)($this->conf['env'] ?? ''));
if ($env !== 'staging') {
$this->fail('Debug nur in Staging erlaubt', null, 403);
if ($env === 'staging') {
return;
}
$host = '';
if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
$host = strtolower(trim(explode(',', (string)$_SERVER['HTTP_X_FORWARDED_HOST'])[0]));
} elseif (!empty($_SERVER['HTTP_HOST'])) {
$host = strtolower((string)$_SERVER['HTTP_HOST']);
}
if ($host !== '') {
$host = preg_replace('/:\\d+$/', '', $host);
if ($host === 'staging.emailtemplate.it') {
return;
}
}
$this->fail('Debug nur in Staging erlaubt', null, 403);
}
private function debugDir(): string