From feb449e479b51036f430407e1163d2ed4e708e8c Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Sun, 18 Nov 2018 19:34:06 +0800 Subject: [PATCH] Fix 'Only variables should be passed by reference' notices in PHP7 --- index.php | 3 ++- weave_storage.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index f424049..0530074 100644 --- a/index.php +++ b/index.php @@ -198,7 +198,8 @@ else if ($_SERVER['REQUEST_METHOD'] == 'PUT') #add a single record to the server { $wbo = new wbo(); - if (!$wbo->extract_json(get_json())) + $json = get_json(); + if (!$wbo->extract_json($json)) report_problem(WEAVE_ERROR_JSON_PARSE, 400); check_quota($db); diff --git a/weave_storage.php b/weave_storage.php index c30b294..6e71fb0 100644 --- a/weave_storage.php +++ b/weave_storage.php @@ -737,10 +737,11 @@ class WeaveStorage try { $update_statement = "update users set login = :logintime where username = :username"; + $time = time(); $sth = $this->_dbh->prepare($update_statement); $sth->bindParam(':username', $username); - $sth->bindParam(':logintime', time()); + $sth->bindParam(':logintime', $time); $sth->execute(); } catch( PDOException $exception )