From: <var...@us...> - 2021-07-02 16:48:10
|
Revision: 10344 http://sourceforge.net/p/phpwiki/code/10344 Author: vargenau Date: 2021-07-02 16:48:08 +0000 (Fri, 02 Jul 2021) Log Message: ----------- PDO: Only variables should be passed by reference Modified Paths: -------------- trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiDB/backend/PDO_oci8.php Modified: trunk/lib/WikiDB/backend/PDO.php =================================================================== --- trunk/lib/WikiDB/backend/PDO.php 2021-07-02 16:13:10 UTC (rev 10343) +++ trunk/lib/WikiDB/backend/PDO.php 2021-07-02 16:48:08 UTC (rev 10344) @@ -327,7 +327,8 @@ . " WHERE pagename=?" . " LIMIT 1"); $sth->bindParam(1, $hits, PDO::PARAM_INT); - $sth->bindParam(2, $this->_serialize($data), PDO::PARAM_LOB); + $serialized_data = $this->_serialize($data); + $sth->bindParam(2, $serialized_data, PDO::PARAM_LOB); $sth->bindParam(3, $pagename, PDO::PARAM_STR, 100); if ($sth->execute()) { $this->commit(); @@ -564,7 +565,8 @@ $sth->bindParam(3, $mtime, PDO::PARAM_INT); $sth->bindParam(4, $minor_edit, PDO::PARAM_INT); $sth->bindParam(5, $content, PDO::PARAM_STR, 100); - $sth->bindParam(6, $this->_serialize($data), PDO::PARAM_STR, 100); + $serialized_data = $this->_serialize($data); + $sth->bindParam(6, $serialized_data, PDO::PARAM_STR, 100); $rs = $sth->execute(); } else { $sth = $dbh->prepare("DELETE FROM $version_tbl" @@ -580,7 +582,8 @@ $sth->bindParam(3, $mtime, PDO::PARAM_INT); $sth->bindParam(4, $minor_edit, PDO::PARAM_INT); $sth->bindParam(5, $content, PDO::PARAM_STR, 100); - $sth->bindParam(6, $this->_serialize($data), PDO::PARAM_STR, 100); + $serialized_data = $this->_serialize($data); + $sth->bindParam(6, $serialized_data, PDO::PARAM_STR, 100); $rs = $sth->execute(); } $this->_update_recent_table($id); @@ -1346,7 +1349,8 @@ $sth->bindParam(5, $entry->request, PDO::PARAM_STR, 255); $sth->bindParam(6, $entry->request_args, PDO::PARAM_STR, 255); $sth->bindParam(7, $entry->request_uri, PDO::PARAM_STR, 255); - $sth->bindParam(8, $entry->_ncsa_time($entry->time), PDO::PARAM_STR, 28); + $ncsa_time = _ncsa_time($entry->time); + $sth->bindParam(8, $ncsa_time, PDO::PARAM_STR, 28); $sth->bindParam(9, $entry->time, PDO::PARAM_INT); $sth->bindParam(10, $entry->status, PDO::PARAM_INT); $sth->bindParam(11, $entry->size, PDO::PARAM_INT); Modified: trunk/lib/WikiDB/backend/PDO_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_oci8.php 2021-07-02 16:13:10 UTC (rev 10343) +++ trunk/lib/WikiDB/backend/PDO_oci8.php 2021-07-02 16:48:08 UTC (rev 10344) @@ -74,7 +74,8 @@ . "request_file,request_uri,request_time,status,bytes_sent,referer,agent,request_duration)" . " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"); // Either use unixtime as %d (long), or the native timestamp format. - $sth->bindParam(1, date('d-M-Y H:i:s', $entry->time)); + $datetime = date('d-M-Y H:i:s', $entry->time); + $sth->bindParam(1, $datetime); $sth->bindParam(2, $entry->host, PDO::PARAM_STR, 100); $sth->bindParam(3, $entry->user, PDO::PARAM_STR, 50); $sth->bindParam(4, $entry->request_method, PDO::PARAM_STR, 10); @@ -81,7 +82,8 @@ $sth->bindParam(5, $entry->request, PDO::PARAM_STR, 255); $sth->bindParam(6, $entry->request_args, PDO::PARAM_STR, 255); $sth->bindParam(7, $entry->request_uri, PDO::PARAM_STR, 255); - $sth->bindParam(8, $entry->_ncsa_time($entry->time), PDO::PARAM_STR, 28); + $ncsa_time = _ncsa_time($entry->time); + $sth->bindParam(8, $ncsa_time, PDO::PARAM_STR, 28); $sth->bindParam(9, $entry->time, PDO::PARAM_INT); $sth->bindParam(10, $entry->status, PDO::PARAM_INT); $sth->bindParam(11, $entry->size, PDO::PARAM_INT); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |