Commit 08deb842 authored by Ivan Tyagov's avatar Ivan Tyagov

in some cases like Web Page content /../ can be contained in image URL which...

in some cases like Web Page content /../ can be contained in image URL which will break restrictedTraverse calls, our best guess is to remove it.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43412 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 485e0857
...@@ -107,6 +107,9 @@ class OOOdCommandTransform(commandtransform): ...@@ -107,6 +107,9 @@ class OOOdCommandTransform(commandtransform):
# <img src="REF.TO.IMAGE" ... /> become <draw:image xlink:href="../REF.TO.IMAGE" ... /> # <img src="REF.TO.IMAGE" ... /> become <draw:image xlink:href="../REF.TO.IMAGE" ... />
# So remove "../" added by OOo # So remove "../" added by OOo
path = CLEAN_RELATIVE_PATH.sub('', path) path = CLEAN_RELATIVE_PATH.sub('', path)
# in some cases like Web Page content "/../" can be contained in image URL which will break
# restrictedTraverse calls, our best guess is to remove it
path = path.replace('/../', '')
# retrieve http parameters and use them to convert image # retrieve http parameters and use them to convert image
query_parameter_string = parse_result[4] query_parameter_string = parse_result[4]
image_parameter_dict = dict(parse_qsl(query_parameter_string)) image_parameter_dict = dict(parse_qsl(query_parameter_string))
......
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