summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2017-02-27 18:05:32 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2017-02-27 18:20:00 +0100
commit62341a3b3409befb0ca24e00e82a8a3c6a59def6 (patch)
treebbf153a4efdcda4f0e048a2e29f0feb35ee5697a /web
parent1bedf736e89fc4cd82f4522ea0747851ff901510 (diff)
downloadaur-62341a3b3409befb0ca24e00e82a8a3c6a59def6.tar.gz
aur-62341a3b3409befb0ca24e00e82a8a3c6a59def6.tar.xz
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>
Diffstat (limited to 'web')
-rw-r--r--web/lib/timezone.inc.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/web/lib/timezone.inc.php b/web/lib/timezone.inc.php
index 9fb24331..949f846d 100644
--- a/web/lib/timezone.inc.php
+++ b/web/lib/timezone.inc.php
@@ -42,6 +42,9 @@ function set_tz() {
if ($result) {
$timezone = $result->fetchColumn(0);
+ if (!$timezone) {
+ unset($timezone);
+ }
}
$update_cookie = true;