From df30ea7a532c28df8352eb2ccdadec3d10e4136d Mon Sep 17 00:00:00 2001 From: souliane Date: Tue, 19 Jan 2016 11:51:07 +0100 Subject: [PATCH] plugin XEP-0071, XEP-0277: method clean_xhtml has been renamed to cleanXHTML --- src/plugins/plugin_xep_0071.py | 2 +- src/plugins/plugin_xep_0277.py | 4 ++-- src/test/test_plugin_misc_text_syntaxes.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/plugin_xep_0071.py b/src/plugins/plugin_xep_0071.py index 11255845..15164cf4 100644 --- a/src/plugins/plugin_xep_0071.py +++ b/src/plugins/plugin_xep_0071.py @@ -118,7 +118,7 @@ class XEP_0071(object): if xhtml: raise exceptions.DataError(_("Can't have xhtml and rich content at the same time")) if xhtml: - d = self.synt_plg.clean_xhtml(xhtml) + d = self.synt_plg.cleanXHTML(xhtml) d.addCallback(syntax_converted) return d diff --git a/src/plugins/plugin_xep_0277.py b/src/plugins/plugin_xep_0277.py index 166f2c87..4b759b20 100755 --- a/src/plugins/plugin_xep_0277.py +++ b/src/plugins/plugin_xep_0277.py @@ -177,7 +177,7 @@ class XEP_0277(object): raise failure.Failure(exceptions.DataError(_('Content of type XHTML must declare its namespace!'))) key = check_conflict(u'{}_xhtml'.format(elem.name)) data = data_elt.toXml() - microblog_data[key] = yield self.host.plugins["TEXT-SYNTAXES"].clean_xhtml(data) + microblog_data[key] = yield self.host.plugins["TEXT-SYNTAXES"].cleanXHTML(data) else: key = check_conflict(elem.name) microblog_data[key] = unicode(elem) @@ -365,7 +365,7 @@ class XEP_0277(object): if '{}_xhtml'.format(elem_name) in data: raise failure.Failure(exceptions.DataError(_("Can't have xhtml and rich content at the same time"))) else: # clean the XHTML input - converted = yield synt.clean_xhtml(data[attr]) + converted = yield synt.cleanXHTML(data[attr]) xml_content = u'
{converted}
'.format( ns=NS_XHTML, diff --git a/src/test/test_plugin_misc_text_syntaxes.py b/src/test/test_plugin_misc_text_syntaxes.py index 372e6b4c..6f5401eb 100644 --- a/src/test/test_plugin_misc_text_syntaxes.py +++ b/src/test/test_plugin_misc_text_syntaxes.py @@ -76,14 +76,14 @@ class SanitisationTest(helpers.SatTestCase): """ - d = self.text_syntaxes.clean_xhtml(self.EVIL_HTML1) + d = self.text_syntaxes.cleanXHTML(self.EVIL_HTML1) d.addCallback(self.assertEqualXML, expected, ignore_blank=True) return d def test_styles_sanitise(self): expected = u"""

test retest
toto

""" - d = self.text_syntaxes.clean_xhtml(self.EVIL_HTML2) + d = self.text_syntaxes.cleanXHTML(self.EVIL_HTML2) d.addCallback(self.assertEqualXML, expected) return d