From 8181d8c08c29fb13d95a924d505b8fed6ccc3f35 Mon Sep 17 00:00:00 2001 From: souliane Date: Wed, 25 Nov 2015 17:19:25 +0100 Subject: [PATCH] plugin XEP-0277: use bare JIDs to verify publisher --- src/plugins/plugin_xep_0277.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/plugin_xep_0277.py b/src/plugins/plugin_xep_0277.py index 8854c4d2..b959ca2b 100755 --- a/src/plugins/plugin_xep_0277.py +++ b/src/plugins/plugin_xep_0277.py @@ -302,10 +302,10 @@ class XEP_0277(object): if not publisher: log.debug("No publisher attribute, we can't verify author jid") microblog_data['author_jid_verified'] = C.BOOL_FALSE - elif publisher == uri: + elif publisher.split("/")[0] == uri.split("/")[0]: microblog_data['author_jid_verified'] = C.BOOL_TRUE else: - log.warning("item atom:uri differ from publisher attribute, spoofing attempt ? atom:uri = {} publisher = {}".format(uri, item_elt.getAttribute("publisher"))) + log.warning("item atom:uri differs from publisher attribute: spoofing attempt? atom:uri = {} publisher = {}".format(uri, item_elt.getAttribute("publisher"))) microblog_data['author_jid_verified'] = C.BOOL_FALSE # email try: