Skip to content

Commit

Permalink
Merge pull request #5728 from mailcow/fix/debug-tz
Browse files Browse the repository at this point in the history
[Web] fix blank /debug page with invalid timezone
  • Loading branch information
FreddleSpl0it committed Feb 14, 2024
2 parents d65a0bb + a0e55cb commit 861fa7b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions data/web/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@
$StartedAt['month'],
$StartedAt['day'],
$StartedAt['year']));
$user_tz = new DateTimeZone(getenv('TZ'));
$date->setTimezone($user_tz);
$started = $date->format('r');
try {
$user_tz = new DateTimeZone(getenv('TZ'));
$date->setTimezone($user_tz);
$started = $date->format('r');
} catch(Exception $e) {
$started = '?';
}
}
else {
$started = '?';
Expand Down

0 comments on commit 861fa7b

Please sign in to comment.