From c2b3d65d62d165ecf15120a7e059c546dbed39f7 Mon Sep 17 00:00:00 2001 From: stevenkellow Date: Sat, 12 Apr 2025 22:51:51 +0100 Subject: [PATCH] Fix PHP deprecation If null is passed to real_escape_string it throws a deprecation error, but null values would not need to be escaped regardless. This will return the null value rather than escaping. --- MysqliDb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MysqliDb.php b/MysqliDb.php index cea80ae..3b585e3 100644 --- a/MysqliDb.php +++ b/MysqliDb.php @@ -1427,7 +1427,7 @@ public function getInsertId() */ public function escape($str) { - return $this->mysqli()->real_escape_string($str); + return $str ? $this->mysqli()->real_escape_string($str) : $str; } /**