Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
37c5e8d7
Commit
37c5e8d7
authored
Jul 05, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport of Webdav adjustments from 2.4 branch
parent
ad91f384
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
lib/python/OFS/PropertySheets.py
lib/python/OFS/PropertySheets.py
+18
-3
No files found.
lib/python/OFS/PropertySheets.py
View file @
37c5e8d7
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Property sheets"""
__version__
=
'$Revision: 1.7
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.7
5
$'
[
11
:
-
2
]
import
time
,
string
,
App
.
Management
,
Globals
from
webdav.WriteLockInterface
import
WriteLockInterface
...
...
@@ -375,7 +375,9 @@ class PropertySheet(Traversable, Persistent, Implicit):
else
:
# Quote non-xml items here?
attrs
=
''
prop
=
' <n:%s%s><![CDATA[%s]]></n:%s>'
%
(
name
,
attrs
,
value
,
name
)
prop
=
' <n:%s%s>%s</n:%s>'
%
(
name
,
attrs
,
xml_escape
(
value
),
name
)
result
.
append
(
prop
)
if
not
result
:
return
''
result
=
join
(
result
,
'
\
n
'
)
...
...
@@ -535,7 +537,7 @@ class DAVProperties(Virtual, PropertySheet, View):
{
'id'
:
'supportedlock'
,
'mode'
:
'r'
},
{
'id'
:
'lockdiscovery'
,
'mode'
:
'r'
},
)
def
getProperty
(
self
,
id
,
default
=
None
):
method
=
'dav__%s'
%
id
if
not
hasattr
(
self
,
method
):
...
...
@@ -804,3 +806,16 @@ def absattr(attr):
if
callable
(
attr
):
return
attr
()
return
attr
def
xml_escape
(
v
):
""" convert any content from ISO-8859-1 to UTF-8
The main use is to escape non-US object property values
(e.g. containing accented characters). Also we convert "<" and ">"
to entities to keep the properties XML compliant.
"""
v
=
str
(
v
).
replace
(
'<'
,
'<'
)
v
=
v
.
replace
(
'>'
,
'>'
)
return
unicode
(
v
,
"latin-1"
).
encode
(
"utf-8"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment