[CMF-checkins] CVS: Products/CMFCore - SkinsTool.py:1.32

Jens Vagelpohl jens at dataflake.org
Wed Apr 6 09:41:31 EDT 2005


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv17779/CMFCore

Modified Files:
	SkinsTool.py 
Log Message:
- CMFCore.SkinsTool: Prevent adding skin layers with invalid path elements
  There is a disconnect between the ability to define what can be ignored
  inside DirectoryViews and what can be put into skins paths in
  the SkinsTool. Now a check is done inside addSkinSelection that makes
  sure the same ignore-policy that is used for the DirectoryView is
  applied to the elements of a skin path.
  (http://www.zope.org/Collectors/CMF/336)


=== Products/CMFCore/SkinsTool.py 1.31 => 1.32 ===
--- Products/CMFCore/SkinsTool.py:1.31	Thu Aug 12 11:07:39 2004
+++ Products/CMFCore/SkinsTool.py	Wed Apr  6 09:41:00 2005
@@ -30,6 +30,9 @@
 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
 from Products.PythonScripts.PythonScript import PythonScript
 
+from DirectoryView import base_ignore
+from DirectoryView import ignore
+from DirectoryView import ignore_re
 from ActionProviderBase import ActionProviderBase
 from permissions import AccessContentsInformation
 from permissions import ManagePortal
@@ -349,6 +352,18 @@
         '''
         sels = self._getSelections()
         skinpath = str(skinpath)
+
+        # Basic precaution to make sure the stuff we want to ignore in
+        # DirectoryViews gets prevented from ending up in a skin path
+        path_elems = [x.strip() for x in skinpath.split(',')]
+        ignored = base_ignore + ignore
+
+        for elem in path_elems[:]:
+            if elem in ignored or ignore_re.match(elem):
+                path_elems.remove(elem)
+
+        skinpath = ','.join(path_elems)
+        
         if test:
             self.testSkinPath(skinpath)
         sels[str(skinname)] = skinpath



More information about the CMF-checkins mailing list