Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/isida/3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiSabler <dissy@ya.ru>2013-11-18 16:30:55 +0400
committerdiSabler <dissy@ya.ru>2013-11-18 16:30:55 +0400
commit7bb0f159f2a9108060a9efe402004bf507a6adb2 (patch)
tree8aee8e44caa5ce7ab0e3bec7736e4fb9d654a615
parenta4ed5995c055e3ec5f3c533e2004ee17b510acb5 (diff)
del: bad regexp catcher
-rw-r--r--plugins/acl.py36
1 files changed, 16 insertions, 20 deletions
diff --git a/plugins/acl.py b/plugins/acl.py
index 32c2db7..e531cfa 100644
--- a/plugins/acl.py
+++ b/plugins/acl.py
@@ -278,26 +278,22 @@ def acl_selector(a,room,jid,nick,mass,was_joined):
acl_action(tmp[3],nick,jid,room,None)
if not acl_ma: break
if itm:
- try:
- was_match = False
- if tmp[1] in ['exp','!exp']:
- if tmp[1][0] == '!' and not re.findall(tmp[2].replace('*','*?'),itm,re.I+re.S+re.U): was_match = True
- elif re.findall(tmp[2].replace('*','*?'),itm,re.I+re.S+re.U): was_match = True
- elif tmp[1] in ['cexp','!cexp']:
- if tmp[1][0] == '!' and not re.findall(tmp[2].replace('*','*?'),itm,re.S+re.U): was_match = True
- elif re.findall(tmp[2].replace('*','*?'),itm,re.S+re.U): was_match = True
- elif tmp[1] in ['sub','!sub']:
- if tmp[1][0] == '!' and tmp[2].lower() not in itm.lower(): was_match = True
- elif tmp[2].lower() in itm.lower(): was_match = True
- elif tmp[1] in ['=','!=']:
- if tmp[1][0] == '!' and not (itm.lower() == tmp[2].lower() or (tmp[0] == 'all' and tmp[2].lower() in (jid.lower(),nick.lower(),mass[0].lower()))): was_match = True
- elif itm.lower() == tmp[2].lower() or (tmp[0] == 'all' and tmp[2].lower() in (jid.lower(),nick.lower(),mass[0].lower())): was_match = True
- if was_match:
- acl_action(tmp[3],nick,jid,room,None)
- if not acl_ma: break
- except:
- writefile(slog_folder % 'bad_stanza_itm_%s.txt' % int(time.time()),unicode(itm).encode('utf-8'))
- writefile(slog_folder % 'bad_stanza_reg_%s.txt' % int(time.time()),unicode(tmp[2]).encode('utf-8'))
+ was_match = False
+ if tmp[1] in ['exp','!exp']:
+ if tmp[1][0] == '!' and not re.findall(tmp[2].replace('*','*?'),itm,re.I+re.S+re.U): was_match = True
+ elif re.findall(tmp[2].replace('*','*?'),itm,re.I+re.S+re.U): was_match = True
+ elif tmp[1] in ['cexp','!cexp']:
+ if tmp[1][0] == '!' and not re.findall(tmp[2].replace('*','*?'),itm,re.S+re.U): was_match = True
+ elif re.findall(tmp[2].replace('*','*?'),itm,re.S+re.U): was_match = True
+ elif tmp[1] in ['sub','!sub']:
+ if tmp[1][0] == '!' and tmp[2].lower() not in itm.lower(): was_match = True
+ elif tmp[2].lower() in itm.lower(): was_match = True
+ elif tmp[1] in ['=','!=']:
+ if tmp[1][0] == '!' and not (itm.lower() == tmp[2].lower() or (tmp[0] == 'all' and tmp[2].lower() in (jid.lower(),nick.lower(),mass[0].lower()))): was_match = True
+ elif itm.lower() == tmp[2].lower() or (tmp[0] == 'all' and tmp[2].lower() in (jid.lower(),nick.lower(),mass[0].lower())): was_match = True
+ if was_match:
+ acl_action(tmp[3],nick,jid,room,None)
+ if not acl_ma: break
def acl_version_async(a, nick, jid, room, mass, lvl, is_answ):
global acl_ver_tmp