[Fix #1724] Ensure that printed json is safe

This commit is contained in:
Mathieu Magnin 2018-04-03 18:05:29 +02:00
parent c670c0fbea
commit 8c1c2f32ca
4 changed files with 51 additions and 3 deletions

View file

@ -30,4 +30,11 @@ module ApplicationHelper
root_path
end
end
def ensure_safe_json(json)
JSON.parse(json).to_json
rescue Exception => e
Raven.capture_exception(e)
{}
end
end