Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes to avoid PHP warnings in v8.2+ #952

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion adodb-csvlib.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ function _rs2serialize(&$rs,$conn=false,$sql='')
$rs2 = new $class(ADORecordSet::DUMMY_QUERY_ID);
$rs2->timeCreated = $rs->timeCreated; # memcache fix
$rs2->sql = $rs->sql;
$rs2->oldProvider = $rs->dataProvider;
$rs2->InitArrayFields($rows,$flds);
$rs2->fetchMode = $savefetch;
return $line.serialize($rs2);
Expand Down
4 changes: 3 additions & 1 deletion adodb.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -4025,6 +4025,7 @@ class ADORecordSet implements IteratorAggregate {
var $_maxRecordCount = 0;
var $datetime = false;


Mike-Benoit marked this conversation as resolved.
Show resolved Hide resolved
public $customActualTypes;
public $customMetaTypes;

Expand Down Expand Up @@ -4790,7 +4791,8 @@ function Close() {
// free connection object - this seems to globally free the object
// and not merely the reference, so don't do this...
// $this->connection = false;
if (!$this->_closed) {
// Also ensure the _queryID is not bogus, as calling Close() may cause an error in the database driver.
if (!$this->_closed && $this->_queryID != -1) {
$this->_closed = true;
return $this->_close();
} else
Expand Down
4 changes: 3 additions & 1 deletion drivers/adodb-postgres64.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ function qStr($s, $magic_quotes=false)
if ($this->_connectionID) {
return "'" . pg_escape_string($this->_connectionID, $s) . "'";
} else {
return "'" . pg_escape_string($s) . "'";
//If there is no database connection, then pg_escape_string() will not work in PHP 8.1+.
// This can occur when using setSessionVariables() in the load balancer, so fall back to emulated escaping in these cases.
return parent::qStr( $s );
Mike-Benoit marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down