Skip to content

Commit

Permalink
Merge pull request #8 from YAmikep/master
Browse files Browse the repository at this point in the history
Fixed escaping body of inboundxml Elements.
  • Loading branch information
0x19 committed Jun 18, 2014
2 parents f63299c + 37f65c6 commit cb1d9a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions telapi/inboundxml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __str__(self):

def __unicode__(self):
attribute_string = ''
body_string = ''.join([unicode(child) for child in self._children]) or self._body
body_string = ''.join([unicode(child) for child in self._children]) or escape(unicode(self._body))

if not self._allow_blank and not body_string.strip():
raise ValueError('The "%s" element cannot be blank!' %
Expand All @@ -42,7 +42,7 @@ def __unicode__(self):
attribute_string = ' ' + ' '.join(['%s="%s"' % (escape(unicode(k)), escape(unicode(v)))
for k, v in self._attributes.items()])

return u"<%s%s>%s</%s>" % (self._element_name, attribute_string, escape(body_string), self._element_name)
return u"<%s%s>%s</%s>" % (self._element_name, attribute_string, body_string, self._element_name)

def _ensure_attribute(self, name):
if name not in self._allowed_attributes:
Expand Down

0 comments on commit cb1d9a7

Please sign in to comment.