FIX Ensure not passing null to mysql methods for PHP 8.1 compatibility

This commit is contained in:
Steve Boyd 2022-06-29 09:34:30 +12:00
parent 98b985fb91
commit a77ca74a7e

View File

@ -151,7 +151,7 @@ class MySQLiConnector extends DBConnector
public function escapeString($value)
{
return $this->dbConn->real_escape_string($value);
return $this->dbConn->real_escape_string($value ?? '');
}
public function quoteString($value)
@ -181,7 +181,7 @@ class MySQLiConnector extends DBConnector
$this->beforeQuery($sql);
// Benchmark query
$handle = $this->dbConn->query($sql, MYSQLI_STORE_RESULT);
$handle = $this->dbConn->query($sql ?? '', MYSQLI_STORE_RESULT);
if (!$handle || $this->dbConn->error) {
$this->databaseError($this->getLastError(), $errorLevel, $sql);
@ -319,7 +319,7 @@ class MySQLiConnector extends DBConnector
public function selectDatabase($name)
{
if ($this->dbConn->select_db($name)) {
if ($this->dbConn->select_db($name ?? '')) {
$this->databaseName = $name;
return true;
}