yxcyxc
This commit is contained in:
@@ -4894,9 +4894,21 @@ SQL;
|
|||||||
|
|
||||||
private function writeDebugLog(string $name, array $payload): void
|
private function writeDebugLog(string $name, array $payload): void
|
||||||
{
|
{
|
||||||
if (strtolower((string)($this->conf['env'] ?? '')) !== 'staging') {
|
$env = strtolower((string)($this->conf['env'] ?? ''));
|
||||||
|
if ($env !== 'staging' && (!defined('APP_ENV') || strtolower((string)APP_ENV) !== 'staging')) {
|
||||||
|
$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;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$dir = $this->debugDir();
|
$dir = $this->debugDir();
|
||||||
if (!is_dir($dir)) {
|
if (!is_dir($dir)) {
|
||||||
@mkdir($dir, 0775, true);
|
@mkdir($dir, 0775, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user