diff options
author | Mark Weiman <mark.weiman@markzz.com> | 2016-11-10 00:54:37 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2016-11-10 18:31:20 +0100 |
commit | 3e442a0f7d49fc8eed45002841d84d9080473cc9 (patch) | |
tree | b2543fd438ee1b38b59f4da3943945a3e9059118 /web/lib/aur.inc.php | |
parent | c3f464f50fb35ffb7825b90437bd912051a994ee (diff) | |
download | aur-3e442a0f7d49fc8eed45002841d84d9080473cc9.tar.gz aur-3e442a0f7d49fc8eed45002841d84d9080473cc9.tar.xz |
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 <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib/aur.inc.php')
-rw-r--r-- | web/lib/aur.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
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); } |