mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-20 13:23:24 -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}}}'):
|
def __init__(self, default='{{{0}}}'):
|
||||||
self.default = default
|
self.default = default
|
||||||
self.eval_regex = re.compile(r'`.*?`')
|
self.eval_regex = re.compile(r'`.*?`')
|
||||||
|
self.eval_replace_regex = re.compile(r'{.*(`.*?`).*}')
|
||||||
self.eval_replace = {
|
self.eval_replace = {
|
||||||
':': '%%colon%%',
|
':': '%%colon%%',
|
||||||
'!': '%%exclamation%%'
|
'!': '%%exclamation%%'
|
||||||
|
@ -1893,7 +1894,7 @@ class CustomFormatter(Formatter):
|
||||||
|
|
||||||
def parse(self, format_string):
|
def parse(self, format_string):
|
||||||
# Replace characters in eval expression
|
# 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
|
replaced = match
|
||||||
for k, v in self.eval_replace.items():
|
for k, v in self.eval_replace.items():
|
||||||
replaced = replaced.replace(k, v)
|
replaced = replaced.replace(k, v)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue