Skip to content

Commit 95d4ce9

Browse files
committed
Escape double quotes in strings
Fixes #124
1 parent 491bca4 commit 95d4ce9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Twig/Extension/FormExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function export_for_js($var)
7171
}
7272

7373
if (is_string($var) && !preg_match($functionPattern, $var) && !preg_match($jsonPattern, $var) && !preg_match($arrayPattern, $var)) {
74-
return '"'.$var.'"';
74+
return '"'.str_replace('"', '"', $var).'"';
7575
}
7676

7777
if (is_array($var)) {

0 commit comments

Comments
 (0)