From: <var...@us...> - 2020-03-23 13:06:04
|
Revision: 10158 http://sourceforge.net/p/phpwiki/code/10158 Author: vargenau Date: 2020-03-23 13:06:02 +0000 (Mon, 23 Mar 2020) Log Message: ----------- fix dba session storage for IPv6 addresses -- patches by Christof Meerwald Modified Paths: -------------- trunk/lib/DbSession/dba.php Modified: trunk/lib/DbSession/dba.php =================================================================== --- trunk/lib/DbSession/dba.php 2020-03-23 13:03:24 UTC (rev 10157) +++ trunk/lib/DbSession/dba.php 2020-03-23 13:06:02 UTC (rev 10158) @@ -125,7 +125,7 @@ if (!$result) { return false; } - list(, , $packed) = explode(':', $result, 3); + list(, , $packed) = explode('|', $result, 3); $this->_disconnect(); if (strlen($packed) > 4000) { // trigger_error("Overlarge session data!", E_USER_WARNING); @@ -166,7 +166,7 @@ trigger_error("Overlarge session data!", E_USER_WARNING); $sess_data = ''; } - $dbh->set($id, $time . ':' . $ip . ':' . $sess_data); + $dbh->set($id, $time . '|' . $ip . '|' . $sess_data); $this->_disconnect(); return true; } @@ -189,12 +189,14 @@ { $dbh = $this->_connect(); $threshold = time() - $maxlifetime; - for ($id = $dbh->firstkey(); $id !== false; $id = $dbh->nextkey()) { + for ($id = $dbh->firstkey(); $id !== false; $id = $nextid) { $result = $dbh->get($id); - list($date, ,) = explode(':', $result, 3); + list($date, ,) = explode('|', $result, 3); + $nextid = $dbh->nextkey(); if ($date < $threshold) $dbh->delete($id); } + $dbh->optimize(); $this->_disconnect(); return true; } @@ -207,7 +209,7 @@ $dbh = $this->_connect(); for ($id = $dbh->firstkey(); $id !== false; $id = $dbh->nextkey()) { $result = $dbh->get($id); - list($date, $ip, $packed) = explode(':', $result, 3); + list($date, $ip, $packed) = explode('|', $result, 3); if (!$packed) continue; // session_data contains the <variable name> + "|" + <packed string> // we need just the wiki_user object (might be array as well) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2020-03-23 13:08:20
|
Revision: 10159 http://sourceforge.net/p/phpwiki/code/10159 Author: vargenau Date: 2020-03-23 13:08:19 +0000 (Mon, 23 Mar 2020) Log Message: ----------- fix returns for dba session API -- patches by Christof Meerwald Modified Paths: -------------- trunk/lib/DbSession/dba.php Modified: trunk/lib/DbSession/dba.php =================================================================== --- trunk/lib/DbSession/dba.php 2020-03-23 13:06:02 UTC (rev 10158) +++ trunk/lib/DbSession/dba.php 2020-03-23 13:08:19 UTC (rev 10159) @@ -97,6 +97,7 @@ { $dbh = $this->_connect(); $dbh->open(); + return true; } /** @@ -110,6 +111,7 @@ public function close() { $this->_disconnect(); + return true; } /** @@ -123,7 +125,7 @@ $dbh = $this->_connect(); $result = $dbh->get($id); if (!$result) { - return false; + return ''; } list(, , $packed) = explode('|', $result, 3); $this->_disconnect(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-01-16 19:24:05
|
Revision: 10240 http://sourceforge.net/p/phpwiki/code/10240 Author: vargenau Date: 2021-01-16 19:24:03 +0000 (Sat, 16 Jan 2021) Log Message: ----------- Same name as parent Modified Paths: -------------- trunk/lib/DbSession/dba.php Modified: trunk/lib/DbSession/dba.php =================================================================== --- trunk/lib/DbSession/dba.php 2021-01-16 19:23:05 UTC (rev 10239) +++ trunk/lib/DbSession/dba.php 2021-01-16 19:24:03 UTC (rev 10240) @@ -49,9 +49,9 @@ array(&$this, 'gc')); } - function quote($str) + function quote($string) { - return $str; + return $string; } function query($sql) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |