Skip to content

Commit 687df01

Browse files
committed
fix escaping quotes
1 parent 1b70bef commit 687df01

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Illuminate/Database/Query/Grammars/Grammar.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ protected function wrapJsonFieldAndPath($column)
12021202
*/
12031203
protected function wrapJsonPath($value, $delimiter = '->')
12041204
{
1205-
$value = preg_replace("/([\\\\]+)?\\'/", "\\'", $value);
1205+
$value = preg_replace("/([\\\\]+)?\\'/", "''", $value);
12061206

12071207
return '\'$."'.str_replace($delimiter, '"."', $value).'"\'';
12081208
}

tests/Database/DatabaseQueryBuilderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2623,7 +2623,7 @@ public function testMySqlWrappingJsonWithBooleanAndIntegerThatLooksLikeOne()
26232623
public function testJsonPathEscaping()
26242624
{
26252625
$expectedWithJsonEscaped = <<<SQL
2626-
select json_unquote(json_extract(`json`, '$."\'))#"'))
2626+
select json_unquote(json_extract(`json`, '$."''))#"'))
26272627
SQL;
26282628

26292629
$builder = $this->getMySqlBuilder();

0 commit comments

Comments
 (0)