Created
May 30, 2012 04:39
-
-
Save mrichie/2833798 to your computer and use it in GitHub Desktop.
protection
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
#save it as config/initializers/html_in_json.rb | |
ActiveSupport.escape_html_entities_in_json = true | |
#next line is not really compulsory. It just sanitizes output(not just replaces with \u values of html entities) to protect you from DOM XSSes. | |
ActiveSupport::JSON::Encoding::ESCAPED_CHARS.merge! '<' => '<' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment