Fix warning with invalid time zone

The SQL query retrieving the time zone from the database may return an
empty result set if the session timeout was reached. Handle such cases
gracefully by leaving the timezone variable unset.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2017-02-27 18:05:32 +01:00
parent 1bedf736e8
commit 62341a3b34

View file

@ -42,6 +42,9 @@ function set_tz() {
if ($result) { if ($result) {
$timezone = $result->fetchColumn(0); $timezone = $result->fetchColumn(0);
if (!$timezone) {
unset($timezone);
}
} }
$update_cookie = true; $update_cookie = true;