summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Taylor <git@ataylor.io>2022-11-01 15:15:08 -0400
committerMarcel Hellkamp <marc@gsites.de>2023-03-04 16:32:26 +0100
commit18a3eb480d251b818223ae64412b128743526e08 (patch)
treeceaa9fdf9ea371cc0ceff1b378933217ddc6f701
parentf84cb81101009504cba785c0e1e68e6b49c12a04 (diff)
downloadbottle-18a3eb480d251b818223ae64412b128743526e08.tar.gz
fix #1155: Catastrophic backtracking issue in template parser.
Related to #1194 This backports the patch from 332215b2b1b3de5a321ba9f3497777fc93662893 to the 0.12 release branch. This fix can be validated using the following repl commands: >>> import bottle >>> bottle.template("""<img src="{{usar_webp(''/static/images/branco400.jpg')}}" alt="Sem imagem"/>""")
-rw-r--r--bottle.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bottle.py b/bottle.py
index 2e7696e..d2d6667 100644
--- a/bottle.py
+++ b/bottle.py
@@ -3489,7 +3489,7 @@ class StplParser(object):
# Match the start tokens of code areas in a template
_re_split = '(?m)^[ \t]*(\\\\?)((%(line_start)s)|(%(block_start)s))(%%?)'
# Match inline statements (may contain python strings)
- _re_inl = '(?m)%%(inline_start)s((?:%s|[^\'"\n]*?)+)%%(inline_end)s' % _re_inl
+ _re_inl = '(?m)%%(inline_start)s((?:%s|[^\'"\n])*?)%%(inline_end)s' % _re_inl
_re_tok = '(?m)' + _re_tok
default_syntax = '<% %> % {{ }}'