Fix bug in upload HTML checker.

If a chunk was passed into the check_html function - e.g. it was read from a compressed file - it would search through each character in the string for certain HTML content instead of each line in the string.
This commit is contained in:
John Chilton
2017-08-12 06:36:50 -04:00
parent 331851b049
commit 7a1fbd37e9
+2
View File
@@ -14,6 +14,8 @@ HTML_CHECK_LINES = 100
def check_html( file_path, chunk=None ):
if chunk is None:
temp = open( file_path, "U" )
elif hasattr(chunk, "splitlines"):
temp = chunk.splitlines()
else:
temp = chunk
regexp1 = re.compile( "<A\s+[^>]*HREF[^>]+>", re.I )