[Zope3-checkins] SVN: Zope3/trunk/ - Fixed issue 680, html files in a resource directory was interpreted

Lennart Regebro regebro at gmail.com
Thu Aug 17 07:16:48 EDT 2006


Log message for revision 69590:
        - Fixed issue 680, html files in a resource directory was interpreted
          as page templates, which used up processing time and caused 
          HTML-resources that were not valid XHTML to fail.
          
          If you want your resources in a resource directory to be interpreted 
          as pagetemplates they now need to have a .pt or .zpt extension.
  
  

Changed:
  U   Zope3/trunk/doc/CHANGES.txt
  U   Zope3/trunk/src/zope/app/publisher/browser/directoryresource.py
  U   Zope3/trunk/src/zope/app/publisher/browser/tests/test_directoryresource.py
  A   Zope3/trunk/src/zope/app/publisher/browser/tests/testfiles/test.html

-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt	2006-08-17 10:40:28 UTC (rev 69589)
+++ Zope3/trunk/doc/CHANGES.txt	2006-08-17 11:16:48 UTC (rev 69590)
@@ -21,6 +21,13 @@
     Restructuring
 
     Bug fixes
+    
+      - Fixed issue 680, html files in a resource directory was interpreted
+        as page templates, which used up processing time and caused 
+        HTML-resources that were not valid XHTML to fail.
+        
+        If you want your resources in a resource directory to be interpreted 
+        as pagetemplates they now need to have a .pt or .zpt extension.
 
       - Fixed issue 676, utilities defined in Zope 3.2 weren't
         converted properly.

Modified: Zope3/trunk/src/zope/app/publisher/browser/directoryresource.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/directoryresource.py	2006-08-17 10:40:28 UTC (rev 69589)
+++ Zope3/trunk/src/zope/app/publisher/browser/directoryresource.py	2006-08-17 11:16:48 UTC (rev 69590)
@@ -58,7 +58,6 @@
         '.jpg':  ImageResourceFactory,
         '.pt':   PageTemplateResourceFactory,
         '.zpt':  PageTemplateResourceFactory,
-        '.html': PageTemplateResourceFactory,
         }
 
     default_factory = FileResourceFactory

Modified: Zope3/trunk/src/zope/app/publisher/browser/tests/test_directoryresource.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/tests/test_directoryresource.py	2006-08-17 10:40:28 UTC (rev 69589)
+++ Zope3/trunk/src/zope/app/publisher/browser/tests/test_directoryresource.py	2006-08-17 11:16:48 UTC (rev 69590)
@@ -118,6 +118,8 @@
         self.assert_(zapi.isinstance(image, FileResource))
         template = resource['test.pt']
         self.assert_(zapi.isinstance(template, PageTemplateResource))
+        file = resource['test.html']
+        self.assert_(zapi.isinstance(file, FileResource))
         file = resource['test.txt']
         self.assert_(zapi.isinstance(file, FileResource))
         file = resource['png']

Added: Zope3/trunk/src/zope/app/publisher/browser/tests/testfiles/test.html
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/tests/testfiles/test.html	2006-08-17 10:40:28 UTC (rev 69589)
+++ Zope3/trunk/src/zope/app/publisher/browser/tests/testfiles/test.html	2006-08-17 11:16:48 UTC (rev 69590)
@@ -0,0 +1 @@
+<html><body><p>test</p></body></html>



More information about the Zope3-Checkins mailing list