From: <var...@us...> - 2021-08-13 16:02:05
|
Revision: 10509 http://sourceforge.net/p/phpwiki/code/10509 Author: vargenau Date: 2021-08-13 16:02:02 +0000 (Fri, 13 Aug 2021) Log Message: ----------- Fix PDO DB sessions Modified Paths: -------------- trunk/lib/DbSession/PDO.php Modified: trunk/lib/DbSession/PDO.php =================================================================== --- trunk/lib/DbSession/PDO.php 2021-08-13 14:39:54 UTC (rev 10508) +++ trunk/lib/DbSession/PDO.php 2021-08-13 16:02:02 UTC (rev 10509) @@ -49,12 +49,10 @@ function & _connect() { $dbh = &$this->_dbh; - if (!$dbh or !is_object($dbh)) { - global $DBParams; - $db = new WikiDB_backend_PDO($DBParams); - $this->_dbh =& $db->_dbh; - $this->_backend =& $db; - } + global $DBParams; + $db = new WikiDB_backend_PDO($DBParams); + $this->_dbh =& $db->_dbh; + $this->_backend =& $db; return $dbh; } @@ -169,7 +167,7 @@ $sess_data = base64_encode($sess_data); $this->_backend->beginTransaction(); - $delete = $this->prepare("DELETE FROM $table WHERE sess_id=?"); + $delete = $dbh->prepare("DELETE FROM $table WHERE sess_id=?"); $delete->bindParam(1, $id, PDO::PARAM_STR, 32); $delete->execute(); $sth = $dbh->prepare("INSERT INTO $table" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |