prevent affiliatio spoofing by checking namespace. Fixes #4323

This commit is contained in:
Yann Leboulanger 2008-09-16 08:30:27 +00:00
parent 330dd0e7a1
commit 3e2f9fcbec
1 changed files with 5 additions and 1 deletions

View File

@ -502,10 +502,14 @@ class Presence(Protocol):
def _muc_getItemAttr(self,tag,attr):
for xtag in self.getTags('x'):
if xtag.getNamespace() not in (NS_MUC_USER, NS_MUC_ADMIN):
continue
for child in xtag.getTags(tag):
return child.getAttr(attr)
def _muc_getSubTagDataAttr(self,tag,attr):
for xtag in self.getTags('x'):
if xtag.getNamespace() not in (NS_MUC_USER, NS_MUC_ADMIN):
continue
for child in xtag.getTags('item'):
for cchild in child.getTags(tag):
return cchild.getData(),cchild.getAttr(attr)
@ -777,4 +781,4 @@ class DataForm(Node):
""" Simple dictionary interface for setting datafields values by their names."""
return self.setField(name).setValue(val)
# vim: se ts=3:
# vim: se ts=3: