[CMF-checkins] CVS: CMF/CMFDefault - Document.py:1.52.10.2

Yvo Schubbe schubbe@web.de
Sun, 2 Feb 2003 10:47:44 -0500


Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv1522/CMFDefault

Modified Files:
      Tag: yuppie-collector041-branch
	Document.py 
Log Message:
first step, second try:
- fixed simplified code (never trust Content-Type for text handling)

=== CMF/CMFDefault/Document.py 1.52.10.1 => 1.52.10.2 ===
--- CMF/CMFDefault/Document.py:1.52.10.1	Sun Feb  2 08:40:05 2003
+++ CMF/CMFDefault/Document.py	Sun Feb  2 10:47:41 2003
@@ -345,15 +345,14 @@
             self.dav__init(REQUEST, RESPONSE)
             self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
         body = REQUEST.get('BODY', '')
-        if REQUEST.get_header('Content-Type', '') == 'text/html':
-            text_format = 'html'
-        else:
-            text_format = None
 
         try:
-            headers, body, text_format = self.handleText(text=body,
-                                                         format=text_format)
+            headers, body, format = self.handleText(text=body)
             safety_belt = headers.get('SafetyBelt', '')
+            if REQUEST.get_header('Content-Type', '') == 'text/html':
+                text_format = 'html'
+            else:
+                text_format = format
             self.setFormat(value=text_format)
             self.setMetadata(headers)
             self._edit(text=body, safety_belt=safety_belt)