[Zope-Checkins] CVS: Zope2 - ObjectManager.py:1.131.2.7

Andreas Jung andreas@dhcp165.digicool.com
Mon, 9 Apr 2001 09:08:31 -0400


Update of /cvs-repository/Zope2/lib/python/OFS
In directory yetix:/work/zope/Zope2_FTP/lib/python/OFS

Modified Files:
      Tag: ajung_Zope2_FTP_globbing_patch
	ObjectManager.py 
Log Message:
removed extended ID patch



--- Updated File ObjectManager.py in package Zope2 --
--- ObjectManager.py	2001/04/04 19:39:24	1.131.2.6
+++ ObjectManager.py	2001/04/09 13:07:13	1.131.2.7
@@ -111,7 +111,7 @@
     XMLExportImport.magic: XMLExportImport.importXML,
     }
 
-bad_id=ts_regex.compile('[^0-9-_~\,\. %s]' % string.letters).search # ajung
+bad_id=ts_regex.compile('[^a-zA-Z0-9-_~\,\. ]' ).search # TS
 
 # Global constants: __replaceable__ flags:
 NOT_REPLACEABLE = 0
@@ -128,7 +128,9 @@
     # set to false before the object is added.
     if not id or (type(id) != type('')):
         raise BadRequestException, 'Empty or invalid id specified.'
-
+    if bad_id(id) != -1:
+        raise BadRequestException, (
+            'The id "%s" contains characters illegal in URLs.' % id)
     if id[0]=='_': raise BadRequestException, (
         'The id "%s" is invalid - it begins with an underscore.'  % id)
     if id[:3]=='aq_': raise BadRequestException, (
@@ -270,9 +272,9 @@
 
     def _setObject(self,id,object,roles=None,user=None, set_owner=1):
 
-        self._checkId(id)
-        id=translationset.filename2objectID(id)
-        
+        v=self._checkId(id)
+        if v is not None: id=v
+ 
         try:    t=object.meta_type
         except: t=None