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:24
Showing 1 changed files
... ...
@@ -113,7 +113,7 @@ function dbclose() {
113 113
 // Used to escape text being put into the database.
114 114
 function escapestring($str) {
115 115
 	global $dbconnect;
116
-   if (!is_array($str)) return $dbconnect->real_escape_string($str);
116
+   if (!is_array($str)) return $dbconnect->real_escape_string(($str===null) ? '' : $str);
117 117
    return array_map('escapestring', $str);
118 118
 }
119 119