Skip to content

Commit

Permalink
Escape double quotes in strings
Browse files Browse the repository at this point in the history
Fixes #124
  • Loading branch information
loostro committed May 20, 2014
1 parent 491bca4 commit 95d4ce9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Twig/Extension/FormExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function export_for_js($var)
}

if (is_string($var) && !preg_match($functionPattern, $var) && !preg_match($jsonPattern, $var) && !preg_match($arrayPattern, $var)) {
return '"'.$var.'"';
return '"'.str_replace('"', '"', $var).'"';
}

if (is_array($var)) {
Expand Down

0 comments on commit 95d4ce9

Please sign in to comment.