Skip to content

Commit

Permalink
Support for more spanish login forms. Additional checks in author's p…
Browse files Browse the repository at this point in the history
…age title username search.
  • Loading branch information
atarantini committed Jul 20, 2011
1 parent a635dc6 commit fe97f47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def check_username(self, username):
"""
data = self.request(self._login_url, [('log', username), ('pwd', str(randint(1, 9999999)))])
if "ERROR" in data or "Error" in data or "login_error" in data:
if "usuario es incorrecto" in data or "Invalid username" in data:
if "usuario es incorrecto" in data or 'usuario no' in data or "Invalid username" in data:
return False
else:
return True
Expand Down Expand Up @@ -226,8 +226,8 @@ def enumerate_usernames(self, gap_tolerance=0):
title_search = re.search("<title>(.*)</title>", data, re.IGNORECASE)
if title_search:
title = title_search.group(1)
# If the title is the same than the last user ID requested, there are no new users
if title == title_cache:
# If the title is the same than the last user ID requested or empty, there are no new users
if title == title_cache or ' ' not in title:
break
else:
title_cache = title
Expand Down

0 comments on commit fe97f47

Please sign in to comment.