plugin extra_pep, params: fixed insecure building of jids_list
This commit is contained in:
parent
ab7ae07a83
commit
77c3e83ec8
1 changed files with 19 additions and 2 deletions
|
|
@ -27,6 +27,7 @@ from sat.core.log import getLogger
|
|||
log = getLogger(__name__)
|
||||
from twisted.internet import defer
|
||||
from twisted.python.failure import Failure
|
||||
from twisted.words.xish import domish
|
||||
from twisted.words.protocols.jabber import jid
|
||||
from sat.tools.xml_tools import paramsXML2XMLUI, getText
|
||||
|
||||
|
|
@ -35,6 +36,18 @@ from sat.tools.xml_tools import paramsXML2XMLUI, getText
|
|||
# this need an overall simplification to make maintenance easier
|
||||
|
||||
|
||||
def createJidElts(jids):
|
||||
"""Generator which return <jid/> elements from jids
|
||||
|
||||
@param jids(iterable[id.jID]): jids to use
|
||||
@return (generator[domish.Element]): <jid/> elements
|
||||
"""
|
||||
for jid_ in jids:
|
||||
jid_elt = domish.Element((None, 'jid'))
|
||||
jid_elt.addContent(jid_.full())
|
||||
yield jid_elt
|
||||
|
||||
|
||||
class Params(object):
|
||||
"""This class manage parameters with xml"""
|
||||
### TODO: add desciption in params
|
||||
|
|
|
|||
Loading…
Reference in a new issue