Commit 71e466f7 authored by Andreas Jung's avatar Andreas Jung

Collector #2247: put values of properties into CDATA section to prevent

non XML compliant documents to be sent to a webdav client
parent fa450f9c
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Property sheets""" """Property sheets"""
__version__='$Revision: 1.73 $'[11:-2] __version__='$Revision: 1.74 $'[11:-2]
import time, string, App.Management, Globals import time, string, App.Management, Globals
from webdav.WriteLockInterface import WriteLockInterface from webdav.WriteLockInterface import WriteLockInterface
...@@ -375,10 +375,11 @@ class PropertySheet(Traversable, Persistent, Implicit): ...@@ -375,10 +375,11 @@ class PropertySheet(Traversable, Persistent, Implicit):
else: else:
# Quote non-xml items here? # Quote non-xml items here?
attrs='' attrs=''
prop=' <n:%s%s>%s</n:%s>' % (name, attrs, value, name) prop=' <n:%s%s><![CDATA[%s]]></n:%s>' % (name, attrs, value, name)
result.append(prop) result.append(prop)
if not result: return '' if not result: return ''
result=join(result, '\n') result=join(result, '\n')
return propstat % (self.xml_namespace(), result, '200 OK', '') return propstat % (self.xml_namespace(), result, '200 OK', '')
def dav__propnames(self, propstat=propstat, join=string.join): def dav__propnames(self, propstat=propstat, join=string.join):
......
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