mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #10377 from creative-commoners/pulls/4.11/mysql-null
FIX Ensure not passing null to mysql methods for PHP 8.1 compatibility
This commit is contained in:
commit
01c27e69de
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user