[Zope-Checkins] CVS: Zope2 - davcmds.py:1.10
Brian Lloyd
brian@digiciool.com
Thu, 8 Mar 2001 11:20:12 -0500 (EST)
Update of /cvs-repository/Zope2/lib/python/webdav
In directory korak:/home/brian/temp/mainline_test/lib/python/webdav
Modified Files:
davcmds.py
Log Message:
merged fix for double-quoting of DAV:href elements
--- Updated File davcmds.py in package Zope2 --
--- davcmds.py 2001/01/31 21:26:57 1.9
+++ davcmds.py 2001/03/08 16:20:12 1.10
@@ -98,6 +98,11 @@
from urllib import quote
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):
"""Emulate required DAV properties for objects which do
not themselves support properties. This is mainly so
@@ -159,7 +164,7 @@
'<d:multistatus xmlns:d="DAV:">\n')
iscol=hasattr(obj, '__dav_collection__')
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'):
propsets=obj.propertysheets.values()
obsheets=obj.propertysheets