Browse Source

Only escape backslashes if they follow "<" in JSON dumping for

templates.
pull/1638/head
Armin Ronacher 15 years ago
parent
commit
06ec917dde
  1. 2
      flask.py

2
flask.py

@ -261,7 +261,7 @@ def _get_package_path(name):
def _tojson_filter(string, *args, **kwargs): def _tojson_filter(string, *args, **kwargs):
"""Calls dumps for the template engine, escaping Slashes properly.""" """Calls dumps for the template engine, escaping Slashes properly."""
return json.dumps(string, *args, **kwargs).replace('/', '\\/') return json.dumps(string, *args, **kwargs).replace('</', '<\\/')
class Flask(object): class Flask(object):

Loading…
Cancel
Save