From 1c9f33c81e22db450b28917ec3fab3378ca9c0e6 Mon Sep 17 00:00:00 2001 From: Juniorbuka Date: Wed, 12 Aug 2026 17:46:31 +0300 Subject: [PATCH] Update SqlFormatter.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Додано окрему обробку значення NULL у SqlFormatter::prepare(). Це запобігає передачі null у htmlspecialchars() та усуває попередження Deprecated у PHP 8.5. --- core/src/Support/Formatter/SqlFormatter.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/Support/Formatter/SqlFormatter.php b/core/src/Support/Formatter/SqlFormatter.php index bdb0002bc8..035fd5fbea 100644 --- a/core/src/Support/Formatter/SqlFormatter.php +++ b/core/src/Support/Formatter/SqlFormatter.php @@ -1748,7 +1748,11 @@ public static function prepare($sql, array $bindings = [], PDO|null $pdo = null) if ($binding instanceof DateTime) { return htmlspecialchars('\''.$binding->format('Y-m-d H:i:s').'\'', ENT_NOQUOTES, 'UTF-8'); } - + + if ($binding === null) { + return 'NULL'; + } + return htmlspecialchars($binding, ENT_NOQUOTES, 'UTF-8'); }, $bindings); $sql = str_replace(['%', '?'], ['%%', '%s'], $sql);