forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a more useful definition of json_escape
The previous definition removed double quote characters, and hence returned invalid JSON, making it unsuitable for the most common use case: bootstrapping JSON in a <script> element. The original definition was at 0ff7a2d, without indication that the double quote behavior was intentional. It seems likely that it was simply an oversight after copy and pasting the definition of html_escape. Furthermore, since json_escape does not return a HTML-safe string if not passed one, it is unnecessary for it to escape characters other than the slash.
- Loading branch information
1 parent
69c2307
commit 59e04d8
Showing
2 changed files
with
16 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters