From 2b346eefc2c63e4e1d528f1e813a939e1a86b1b5 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Fri, 6 Nov 2026 18:42:50 +0300 Subject: [PATCH] Improve escaping in HasCastable.php --- src/Concerns/HasCastable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Concerns/HasCastable.php b/src/Concerns/HasCastable.php index 055c01c..6aa3b08 100644 --- a/src/Concerns/HasCastable.php +++ b/src/Concerns/HasCastable.php @@ -42,6 +42,6 @@ protected function castValue(mixed $value = null): float|int|string return '[]'; } - return "'" . addslashes($value) . "'"; + return "'" . str_replace(['\\', "'"], ['\\\\', "\\'"], stripslashes($value)) . "'"; } }