Re-fixed new, faster Liquidpy to run in wild mode (arbitrary code exec)

This commit is contained in:
frikky
2021-09-04 22:22:44 +02:00
parent 2fca3957c6
commit 3ea8e5ad72
+6 -8
View File
@@ -1559,7 +1559,7 @@ class AppBase:
#print(globals()) #print(globals())
print("Running liquid with data of length %d" % len(template)) print("Running liquid with data of length %d" % len(template))
run = Liquid(template, {'mode': 'wild'}) run = Liquid(template, mode="wild", from_file=False)
# Can't handle self yet (?) # Can't handle self yet (?)
ret = run.render(**globals()) ret = run.render(**globals())
@@ -1573,14 +1573,12 @@ class AppBase:
# return ret # return ret
#except liquid.exceptions.LiquidRenderError as e: #except liquid.exceptions.LiquidRenderError as e:
# print("Render error: %s" % e) # print("Render error: %s" % e)
except jinja2.exceptions.TemplateNotFound as e:
except liquid.exceptions.LiquidRenderError as e: print("[ERROR] Template error: %s" % e)
print("Render error: %s" % e) except jinja2.exceptions.TemplateSyntaxError as e:
except liquid.exceptions.LiquidSyntaxError as e: print("[ERROR] Syntax error: %s" % e)
print("Syntax error: %s" % e)
except: except:
print("General exception for liquid") print("[ERROR] General exception for liquid")
pass
return template return template