# HG changeset patch # User Goffi # Date 1448974548 -3600 # Node ID c47ba491a85a5b2bed03b55c6648c36573fee786 # Parent 6d6eae4906819e635a3390f33604c3f81c5caba2 plugin XEP-0277: raise a failure if XHTML content is not wrapped in a
diff -r 6d6eae490681 -r c47ba491a85a src/plugins/plugin_xep_0277.py --- a/src/plugins/plugin_xep_0277.py Tue Dec 01 13:55:48 2015 +0100 +++ b/src/plugins/plugin_xep_0277.py Tue Dec 01 13:55:48 2015 +0100 @@ -173,6 +173,8 @@ type_ = elem.getAttribute('type') if type_ == 'xhtml': data_elt = elem.firstChildElement() + if data_elt is None: + raise failure.Failure(exceptions.DataError(u"XHML content not wrapped in a
element, this is not standard !")) if data_elt.uri != NS_XHTML: raise failure.Failure(exceptions.DataError(_('Content of type XHTML must declare its namespace!'))) key = check_conflict(u'{}_xhtml'.format(elem.name))