Commit 3ca7bc49 authored by Sven Franck's avatar Sven Franck

erp5_web: raise non-base64 convert instead of letting cloudoo guess

parent 9dea97d6
......@@ -132,10 +132,15 @@ def handleHref(href):
return href
try:
obj = traverseHref(href)
except (KeyError, Unauthorized):
# KeyError can be side_object_dict[domain] KeyError
# or restrictedTraverse(path) KeyError
return makeHrefAbsolute(href)
except KeyError:
raise Exception("KeyError: %s" % (href))
except Unauthorized:
raise Exception("Unauthorized: %s" % (href))
#except (KeyError, Unauthorized):
## KeyError can be side_object_dict[domain] KeyError
## or restrictedTraverse(path) KeyError
# impossible to debug if we let cloudooo decide what to do
#return makeHrefAbsolute(href)
return handleHrefObject(obj, href)
def handleImageSource(src):
......@@ -202,7 +207,6 @@ def handleHrefObject(obj, src, default_mimetype="text/html", default_data="<p>Li
if isinstance(data, unicode):
data = data.encode("utf-8")
return handleLinkedData(mime, data, src)
return handleLinkedData(default_mimetype, default_data, src)
bad_image_data_url = (
......@@ -352,5 +356,4 @@ def anny(iterable, key=None):
if i:
return True
return False
return main(data)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment