mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 21:03:21 -07:00
Fix replacement of colon and exclamation outside of eval expression
This commit is contained in:
parent
830ef460af
commit
9fddcf3057
1 changed files with 2 additions and 1 deletions
|
@ -1841,6 +1841,7 @@ class CustomFormatter(Formatter):
|
|||
def __init__(self, default='{{{0}}}'):
|
||||
self.default = default
|
||||
self.eval_regex = re.compile(r'`.*?`')
|
||||
self.eval_replace_regex = re.compile(r'{.*(`.*?`).*}')
|
||||
self.eval_replace = {
|
||||
':': '%%colon%%',
|
||||
'!': '%%exclamation%%'
|
||||
|
@ -1893,7 +1894,7 @@ class CustomFormatter(Formatter):
|
|||
|
||||
def parse(self, format_string):
|
||||
# Replace characters in eval expression
|
||||
for match in re.findall(self.eval_regex, format_string):
|
||||
for match in re.findall(self.eval_replace_regex, format_string):
|
||||
replaced = match
|
||||
for k, v in self.eval_replace.items():
|
||||
replaced = replaced.replace(k, v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue