Skip to content

Commit

Permalink
Avoid division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
csnardi committed Dec 29, 2015
1 parent 04f18a2 commit 9ce6e46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion findspam.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def has_few_characters(s, site):


def has_repeating_characters(s, site):
s = regex.sub('http[^"]*', "", s) # remove URLs for this check
if s is None or len(s) == 0:
return False, ""
s = regex.sub('http[^"]*', "", s) # remove URLs for this check
matches = regex.compile("([^\\s_.,?!=~*/0-9-])(\\1{10,})", regex.UNICODE).findall(s)
matches = ["".join(match) for match in matches]
match = "".join(matches)
Expand Down

0 comments on commit 9ce6e46

Please sign in to comment.