Commit 200b1920 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Text Document are intended to support more than just HTML.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15681 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 72a3fa47
......@@ -107,15 +107,18 @@ class TextDocument(Document, TextContent):
kw.setdefault('text_format', format)
kw.setdefault('text_content', text_content)
del kw['file']
# check if it's safe to save HTML content
# By default FCKEditor used to edit Web Pages wouldn't allow inserting
# HTML tags (will replace them accordingly) so this is the last possible
# step where we can check if any other scripts wouldn't try to set manually
# bad HTML content.
if isHTMLSafe(kw.get('text_content', '')):
# The following has been commented because a TextDocument
# instance may contain something else than HTML
## Check if it's safe to save HTML content
## By default FCKEditor used to edit Web Pages wouldn't allow inserting
## HTML tags (will replace them accordingly) so this is the last possible
## step where we can check if any other scripts wouldn't try to set manually
## bad HTML content.
# if isHTMLSafe(kw.get('text_content', '')):
# Document._edit(self, **kw)
# else:
# raise ValueError, "HTML contains illegal tags."
Document._edit(self, **kw)
else:
raise ValueError, "HTML contains illegal tags."
security.declareProtected( Permissions.ModifyPortalContent, 'edit' )
edit = WorkflowMethod( _edit )
......
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