Skip to content

Commit

Permalink
Merge pull request #10377 from creative-commoners/pulls/4.11/mysql-null
Browse files Browse the repository at this point in the history
FIX Ensure not passing null to mysql methods for PHP 8.1 compatibility
  • Loading branch information
GuySartorelli authored Jun 28, 2022
2 parents 98b985f + a77ca74 commit 01c27e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ORM/Connect/MySQLiConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function __destruct()

public function escapeString($value)
{
return $this->dbConn->real_escape_string($value);
return $this->dbConn->real_escape_string($value ?? '');
}

public function quoteString($value)
Expand Down Expand Up @@ -181,7 +181,7 @@ public function query($sql, $errorLevel = E_USER_ERROR)
$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);
Expand Down Expand Up @@ -319,7 +319,7 @@ public function preparedQuery($sql, $parameters, $errorLevel = E_USER_ERROR)

public function selectDatabase($name)
{
if ($this->dbConn->select_db($name)) {
if ($this->dbConn->select_db($name ?? '')) {
$this->databaseName = $name;
return true;
}
Expand Down

0 comments on commit 01c27e6

Please sign in to comment.