From 3e442a0f7d49fc8eed45002841d84d9080473cc9 Mon Sep 17 00:00:00 2001 From: Mark Weiman Date: Wed, 9 Nov 2016 18:54:37 -0500 Subject: Remove all usage of UNIX_TIMESTAMP in web interface UNIX_TIMESTAMP is not part of the SQL standard. Instead, all usage in the web interface is changed to use PHP's time() function. Signed-off-by: Mark Weiman Signed-off-by: Lukas Fleischer --- web/lib/aur.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/lib/aur.inc.php') diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index 9015ae8f..67dd1c14 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php @@ -38,7 +38,7 @@ function check_sid() { # the visitor is logged in, try and update the session # $dbh = DB::connect(); - $q = "SELECT LastUpdateTS, UNIX_TIMESTAMP() FROM Sessions "; + $q = "SELECT LastUpdateTS, " . strval(time()) . " FROM Sessions "; $q.= "WHERE SessionID = " . $dbh->quote($_COOKIE["AURSID"]); $result = $dbh->query($q); $row = $result->fetch(PDO::FETCH_NUM); @@ -77,7 +77,7 @@ function check_sid() { # This keeps 'remembered' sessions from being # overwritten. if ($last_update < time() + $timeout) { - $q = "UPDATE Sessions SET LastUpdateTS = UNIX_TIMESTAMP() "; + $q = "UPDATE Sessions SET LastUpdateTS = " . strval(time()) . " "; $q.= "WHERE SessionID = " . $dbh->quote($_COOKIE["AURSID"]); $dbh->exec($q); } -- cgit v1.2.3-24-g4f1b