From b8d592d009e2d90142373b8a1360e04ac961f570 Mon Sep 17 00:00:00 2001 From: Miguel Muscat Date: Tue, 13 Feb 2024 11:46:26 +0100 Subject: [PATCH] feat: escape string terms --- src/Expression/Term.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Expression/Term.php b/src/Expression/Term.php index 54c997e..8c1772f 100644 --- a/src/Expression/Term.php +++ b/src/Expression/Term.php @@ -54,7 +54,8 @@ protected function toBaseString(): string case self::NUMBER: return (string) $this->value; case self::STRING: - return "'$this->value'"; + $esc = addslashes((string) $this->value); + return "'$esc'"; case self::BOOLEAN: return $this->value ? 'TRUE' : 'FALSE'; case self::LIST: