Browse code

includes/mysqli_functions.php: mysqli_real_escape_string() does not like null entries [deprecated since PHP 8.1], so an empty string should take their place - fix

Clarissa Walker authored on 2026/11/07 13:31:40
Showing 1 changed files
... ...
@@ -103,7 +103,7 @@ function dbclose() {
103 103
 // Used to escape text being put into the database.
104 104
 function escapestring($str) {
105 105
 	global $dbconnect;
106
-   if (!is_array($str)) return $dbconnect->real_escape_string($str);
106
+   if (!is_array($str)) return $dbconnect->real_escape_string(($str===null) ? '' : $str);
107 107
    return array_map('escapestring', $str);
108 108
 }
109 109