From 687df01fa19c99546c1ae1dd53c2a465459b50dc Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 5 Aug 2020 14:45:20 -0500 Subject: [PATCH] fix escaping quotes --- src/Illuminate/Database/Query/Grammars/Grammar.php | 2 +- tests/Database/DatabaseQueryBuilderTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Query/Grammars/Grammar.php b/src/Illuminate/Database/Query/Grammars/Grammar.php index a661d2103f05..a7b930e16e22 100755 --- a/src/Illuminate/Database/Query/Grammars/Grammar.php +++ b/src/Illuminate/Database/Query/Grammars/Grammar.php @@ -1202,7 +1202,7 @@ protected function wrapJsonFieldAndPath($column) */ protected function wrapJsonPath($value, $delimiter = '->') { - $value = preg_replace("/([\\\\]+)?\\'/", "\\'", $value); + $value = preg_replace("/([\\\\]+)?\\'/", "''", $value); return '\'$."'.str_replace($delimiter, '"."', $value).'"\''; } diff --git a/tests/Database/DatabaseQueryBuilderTest.php b/tests/Database/DatabaseQueryBuilderTest.php index 070cb9b8eaec..15ce14f26165 100755 --- a/tests/Database/DatabaseQueryBuilderTest.php +++ b/tests/Database/DatabaseQueryBuilderTest.php @@ -2623,7 +2623,7 @@ public function testMySqlWrappingJsonWithBooleanAndIntegerThatLooksLikeOne() public function testJsonPathEscaping() { $expectedWithJsonEscaped = <<getMySqlBuilder();