Merge pull request #7971 from adityahase/fix-jinja-2-develop

fix(security): Make jinja rendering tighter
This commit is contained in:
sahil28297 2019-07-24 18:46:58 +05:30 committed by GitHub
commit eb03d9bbb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,7 +71,7 @@ def render_template(template, context, is_path=None, safe_render=True):
or (template.endswith('.html') and '\n' not in template)):
return get_jenv().get_template(template).render(context)
else:
if safe_render and ".__" in template:
if safe_render and "__" in template:
throw("Illegal template")
try:
return get_jenv().from_string(template).render(context)