diff options
author | Aaron Taylor <git@ataylor.io> | 2022-11-01 15:15:08 -0400 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2023-03-04 16:32:26 +0100 |
commit | 18a3eb480d251b818223ae64412b128743526e08 (patch) | |
tree | ceaa9fdf9ea371cc0ceff1b378933217ddc6f701 | |
parent | f84cb81101009504cba785c0e1e68e6b49c12a04 (diff) | |
download | bottle-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.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 = '<% %> % {{ }}' |