Commit 80f49336 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

try to parse latin-1 encoded url (even though that is invalid according to RFC 3986).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42160 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 55548745
...@@ -3187,6 +3187,7 @@ class ScalarMaxConflictResolver(persistent.Persistent): ...@@ -3187,6 +3187,7 @@ class ScalarMaxConflictResolver(persistent.Persistent):
################### ###################
# URL Normaliser # # URL Normaliser #
################### ###################
from Products.PythonScripts.standard import url_unquote
try: try:
import urlnorm import urlnorm
except ImportError: except ImportError:
...@@ -3258,6 +3259,11 @@ def urlnormNormaliseUrl(url, base_url=None): ...@@ -3258,6 +3259,11 @@ def urlnormNormaliseUrl(url, base_url=None):
""" """
try: try:
url = urlnorm.norm(url) url = urlnorm.norm(url)
except UnicodeDecodeError:
try:
url = urlnorm.norm(url_unquote(url).decode('latin1'))
except UnicodeDecodeError:
raise urlnorm.InvalidUrl
except (AttributeError, urlnorm.InvalidUrl): except (AttributeError, urlnorm.InvalidUrl):
# This url is not valid, a better Exception will # This url is not valid, a better Exception will
# be raised # be raised
......
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