master
mutantmonkey 2011-09-14 20:27:29 -04:00
parent 213b83871d
commit 8d4e0a741b
1 changed files with 2 additions and 2 deletions

View File

@ -31,9 +31,9 @@ def hs(phenny, input):
results = RESULTS_URL.format(urlquote(q)) results = RESULTS_URL.format(urlquote(q))
try: try:
s = search('(|(uupid={0})(mail={0})(cn={1}))'.format(q[0], ' '.join(q))) s = search('(|(uupid={0})(mail={0})(cn={1}))'.format(q))
if not s: if not s:
s = search('(|(uupid=*{0}*)(mail=*{0}*)(cn=*{1}*))'.format(q[0], '*'.join(q))) s = search('(|(uupid=*{0}*)(mail=*{0}*)(cn=*{1}*))'.format(q, '*'.join(q.split(' '))))
except ldap.FILTER_ERROR: except ldap.FILTER_ERROR:
phenny.reply('Filter error; try to avoid injection attacks in the future please.') phenny.reply('Filter error; try to avoid injection attacks in the future please.')
return return