adasd
This commit is contained in:
@@ -418,9 +418,21 @@ namespace {
|
||||
if (!function_exists('nexus_display_timezone_name')) {
|
||||
function nexus_display_timezone_name(): string
|
||||
{
|
||||
$timezone = trim((string) date_default_timezone_get());
|
||||
$candidates = [
|
||||
$_COOKIE['desktop_timezone'] ?? null,
|
||||
$_SESSION['desktop_timezone'] ?? null,
|
||||
getenv('DESKTOP_TIMEZONE') ?: null,
|
||||
'Europe/Berlin',
|
||||
];
|
||||
|
||||
return $timezone !== '' ? $timezone : 'Europe/Berlin';
|
||||
foreach ($candidates as $candidate) {
|
||||
$timezone = trim((string) $candidate);
|
||||
if ($timezone !== '' && in_array($timezone, \DateTimeZone::listIdentifiers(), true)) {
|
||||
return $timezone;
|
||||
}
|
||||
}
|
||||
|
||||
return 'Europe/Berlin';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user