diff --git a/product/ERP5/Document/Url.py b/product/ERP5/Document/Url.py index 3e096a8cb0f555a69074cfdb02c1c1cab744db60..6ac2edccd9752a5b1b562a32428a0ec5e940d82f 100644 --- a/product/ERP5/Document/Url.py +++ b/product/ERP5/Document/Url.py @@ -55,8 +55,6 @@ class UrlMixIn: url_string = self.getUrlString() if not url_string: return None - if urllib.splittype(url_string)[0]: - return url_string protocol = self.getUrlProtocol() if not protocol: # A quick fix for all objects which did not @@ -66,8 +64,13 @@ class UrlMixIn: protocol = default_protocol_dict[ptype] else: protocol = 'http' + if protocol in no_host_protocol_list or url_string.startswith('//'): return '%s:%s' % (protocol, url_string) + + if url_string.startswith(protocol): + return url_string + return '%s://%s' % (protocol, url_string) security.declareProtected(Permissions.ModifyPortalContent, 'fromText')