105105from lib .core .settings import DEFAULT_MSSQL_SCHEMA
106106from lib .core .settings import DEV_EMAIL_ADDRESS
107107from lib .core .settings import DUMMY_USER_INJECTION
108- from lib .core .settings import DYNAMICITY_MARK_LENGTH
108+ from lib .core .settings import DYNAMICITY_BOUNDARY_LENGTH
109109from lib .core .settings import ERROR_PARSING_REGEXES
110110from lib .core .settings import FILE_PATH_REGEXES
111111from lib .core .settings import FORCE_COOKIE_EXPIRATION_TIME
@@ -2795,7 +2795,7 @@ def findDynamicContent(firstPage, secondPage):
27952795 for block in blocks [:]:
27962796 (_ , _ , length ) = block
27972797
2798- if length <= DYNAMICITY_MARK_LENGTH :
2798+ if length <= 2 * DYNAMICITY_BOUNDARY_LENGTH :
27992799 blocks .remove (block )
28002800
28012801 # Making of dynamic markings based on prefix/suffix principle
@@ -2814,6 +2814,9 @@ def findDynamicContent(firstPage, secondPage):
28142814 continue
28152815
28162816 if prefix and suffix :
2817+ prefix = prefix [- DYNAMICITY_BOUNDARY_LENGTH :]
2818+ suffix = suffix [:DYNAMICITY_BOUNDARY_LENGTH ]
2819+
28172820 infix = max (re .search (r"(?s)%s(.+)%s" % (re .escape (prefix ), re .escape (suffix )), _ ) for _ in (firstPage , secondPage )).group (1 )
28182821
28192822 if infix [0 ].isalnum ():
@@ -2822,7 +2825,7 @@ def findDynamicContent(firstPage, secondPage):
28222825 if infix [- 1 ].isalnum ():
28232826 suffix = trimAlphaNum (suffix )
28242827
2825- kb .dynamicMarkings .append ((prefix [ - DYNAMICITY_MARK_LENGTH / 2 :] if prefix else None , suffix [: DYNAMICITY_MARK_LENGTH / 2 ] if suffix else None ))
2828+ kb .dynamicMarkings .append ((prefix if prefix else None , suffix if suffix else None ))
28262829
28272830 if len (kb .dynamicMarkings ) > 0 :
28282831 infoMsg = "dynamic content marked for removal (%d region%s)" % (len (kb .dynamicMarkings ), 's' if len (kb .dynamicMarkings ) > 1 else '' )
0 commit comments