Slight update for a greatest.py (more general approach)

This commit is contained in:
Miroslav Stampar 2013-01-25 10:37:45 +01:00
parent ac6c9a808a
commit e150316d97

View File

@ -37,7 +37,7 @@ def tamper(payload, **kwargs):
retVal = payload
if payload:
match = re.search(r"(?i)(\b(AND|OR)\b\s+)(?!.*\b(AND|OR)\b)([^>]+?)\s*>\s*([\d(+\-*/)]+)\s*\Z", payload)
match = re.search(r"(?i)(\b(AND|OR)\b\s+)(?!.*\b(AND|OR)\b)([^>]+?)\s*>\s*([^>]+)\s*\Z", payload)
if match:
_ = "%sGREATEST(%s,%s+1)=%s" % (match.group(1), match.group(4), match.group(5), match.group(4))