Commit 8a032f95 authored by Sidnei da Silva's avatar Sidnei da Silva

Escape value on propstat the same way its done on allprops.

parent ba946870
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"""Property sheets""" """Property sheets"""
__version__='$Revision: 1.93 $'[11:-2] __version__='$Revision: 1.94 $'[11:-2]
import time, App.Management, Globals, sys import time, App.Management, Globals, sys
from webdav.WriteLockInterface import WriteLockInterface from webdav.WriteLockInterface import WriteLockInterface
...@@ -331,10 +331,9 @@ class PropertySheet(Traversable, Persistent, Implicit): ...@@ -331,10 +331,9 @@ class PropertySheet(Traversable, Persistent, Implicit):
# Quote non-xml items here? # Quote non-xml items here?
attrs='' attrs=''
if hasattr(self,"dav__"+name): if not hasattr(self,"dav__"+name):
prop=' <n:%s%s>%s</n:%s>' % (name, attrs, value, name) value = xml_escape(value)
else: prop=' <n:%s%s>%s</n:%s>' % (name, attrs, value, name)
prop=' <n:%s%s>%s</n:%s>' % (name, attrs, xml_escape(value), name)
result.append(prop) result.append(prop)
if not result: return '' if not result: return ''
...@@ -382,8 +381,10 @@ class PropertySheet(Traversable, Persistent, Implicit): ...@@ -382,8 +381,10 @@ class PropertySheet(Traversable, Persistent, Implicit):
else: else:
# quote non-xml items here? # quote non-xml items here?
attrs='' attrs=''
if not hasattr(self, 'dav__%s' % name):
value = xml_escape(value)
prop='<n:%s%s xmlns:n="%s">%s</n:%s>\n' % ( prop='<n:%s%s xmlns:n="%s">%s</n:%s>\n' % (
name, attrs, xml_id, value, name) name, attrs, xml_id, value, name)
code='200 OK' code='200 OK'
if not result.has_key(code): if not result.has_key(code):
result[code]=[prop] result[code]=[prop]
......
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