Commit 972410ff authored by 's avatar

merged fix for double-quoting of DAV:href elements

parent 36fcf02f
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
"""WebDAV xml request objects.""" """WebDAV xml request objects."""
__version__='$Revision: 1.9 $'[11:-2] __version__='$Revision: 1.10 $'[11:-2]
import sys, os, string, regex import sys, os, string, regex
from common import absattr, aq_base, urlfix, urlbase from common import absattr, aq_base, urlfix, urlbase
...@@ -98,6 +98,11 @@ from cStringIO import StringIO ...@@ -98,6 +98,11 @@ from cStringIO import StringIO
from urllib import quote from urllib import quote
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
def safe_quote(url, mark=r'%', find=string.find):
if find(url, mark) > -1:
return url
return quote(url)
class DAVProps(DAVProperties): class DAVProps(DAVProperties):
"""Emulate required DAV properties for objects which do """Emulate required DAV properties for objects which do
not themselves support properties. This is mainly so not themselves support properties. This is mainly so
...@@ -159,7 +164,7 @@ class PropFind: ...@@ -159,7 +164,7 @@ class PropFind:
'<d:multistatus xmlns:d="DAV:">\n') '<d:multistatus xmlns:d="DAV:">\n')
iscol=hasattr(obj, '__dav_collection__') iscol=hasattr(obj, '__dav_collection__')
if iscol and url[-1] != '/': url=url+'/' if iscol and url[-1] != '/': url=url+'/'
result.write('<d:response>\n<d:href>%s</d:href>\n' % quote(url)) result.write('<d:response>\n<d:href>%s</d:href>\n' % safe_quote(url))
if hasattr(aq_base(obj), 'propertysheets'): if hasattr(aq_base(obj), 'propertysheets'):
propsets=obj.propertysheets.values() propsets=obj.propertysheets.values()
obsheets=obj.propertysheets obsheets=obj.propertysheets
......
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