fix removeDynamicContent bug

double re.escape() in "findDynamicContent" function and "removeDynamicContent" function leads an bug in finding dynamic content,
This commit is contained in:
KingX 2015-08-22 14:05:03 +08:00
parent f609158d1b
commit 3ebb3e6f4f

View File

@ -2580,7 +2580,7 @@ def findDynamicContent(firstPage, secondPage):
prefix = trimAlphaNum(prefix) prefix = trimAlphaNum(prefix)
suffix = trimAlphaNum(suffix) suffix = trimAlphaNum(suffix)
kb.dynamicMarkings.append((re.escape(prefix[-DYNAMICITY_MARK_LENGTH / 2:]) if prefix else None, re.escape(suffix[:DYNAMICITY_MARK_LENGTH / 2]) if suffix else None)) kb.dynamicMarkings.append((prefix[-DYNAMICITY_MARK_LENGTH / 2:] if prefix else None, suffix[:DYNAMICITY_MARK_LENGTH / 2] if suffix else None))
if len(kb.dynamicMarkings) > 0: if len(kb.dynamicMarkings) > 0:
infoMsg = "dynamic content marked for removal (%d region%s)" % (len(kb.dynamicMarkings), 's' if len(kb.dynamicMarkings) > 1 else '') infoMsg = "dynamic content marked for removal (%d region%s)" % (len(kb.dynamicMarkings), 's' if len(kb.dynamicMarkings) > 1 else '')