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
76cb9061
Commit
76cb9061
authored
May 08, 2006
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bring back some junk that's apparently needed
parent
c9cb902d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
lib/python/Products/PageTemplates/PageTemplateFile.py
lib/python/Products/PageTemplates/PageTemplateFile.py
+17
-0
No files found.
lib/python/Products/PageTemplates/PageTemplateFile.py
View file @
76cb9061
...
@@ -208,3 +208,20 @@ class PageTemplateFile(SimpleItem, Script, PT, Traversable):
...
@@ -208,3 +208,20 @@ class PageTemplateFile(SimpleItem, Script, PT, Traversable):
"cannot be stored."
%
self
.
__class__
.
__name__
)
"cannot be stored."
%
self
.
__class__
.
__name__
)
InitializeClass
(
PageTemplateFile
)
InitializeClass
(
PageTemplateFile
)
XML_PREFIXES
=
[
"<?xml"
,
# ascii, utf-8
"
\
xef
\
xbb
\
xbf
<?xml"
,
# utf-8 w/ byte order mark
"
\
0
<
\
0
?
\
0
x
\
0
m
\
0
l"
,
# utf-16 big endian
"<
\
0
?
\
0
x
\
0
m
\
0
l
\
0
"
,
# utf-16 little endian
"
\
xfe
\
xff
\
0
<
\
0
?
\
0
x
\
0
m
\
0
l"
,
# utf-16 big endian w/ byte order mark
"
\
xff
\
xfe
<
\
0
?
\
0
x
\
0
m
\
0
l
\
0
"
,
# utf-16 little endian w/ byte order mark
]
XML_PREFIX_MAX_LENGTH
=
max
(
map
(
len
,
XML_PREFIXES
))
def
sniff_type
(
text
):
for
prefix
in
XML_PREFIXES
:
if
text
.
startswith
(
prefix
):
return
"text/xml"
return
None
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