Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
a5e591cc
Commit
a5e591cc
authored
Mar 10, 2006
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed checkValidId, disallowing IDs starting with '@'
parent
e7adbdd2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
0 deletions
+8
-0
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+3
-0
lib/python/OFS/tests/testObjectManager.py
lib/python/OFS/tests/testObjectManager.py
+2
-0
No files found.
doc/CHANGES.txt
View file @
a5e591cc
...
...
@@ -18,6 +18,9 @@ Zope Changes
Bugs fixed
- OFS ObjectManager: Fixed 'checkValidId'.
Names starting with '@' are reserved for views and not allowed in IDs.
- Collector #2039: 'ZPublisher.HTTPRequest.HTTPRequest._authUserPW'
choked on passwords which contained colons.
...
...
lib/python/OFS/ObjectManager.py
View file @
a5e591cc
...
...
@@ -72,6 +72,9 @@ def checkValidId(self, id, allow_dup=0):
'The id "%s" is invalid because it begins with "aq_".'
%
id
)
if
id
.
endswith
(
'__'
):
raise
BadRequest
,
(
'The id "%s" is invalid because it ends with two underscores.'
%
id
)
if
id
[
0
]
==
'@'
:
raise
BadRequest
(
'The id "%s" is invalid because it begins with '
'"@".'
%
id
)
if
not
allow_dup
:
obj
=
getattr
(
self
,
id
,
None
)
if
obj
is
not
None
:
...
...
lib/python/OFS/tests/testObjectManager.py
View file @
a5e591cc
...
...
@@ -354,6 +354,8 @@ class ObjectManagerTests( unittest.TestCase ):
self
.
assertRaises
(
BadRequest
,
om
.
_setObject
,
'111'
,
si
)
self
.
assertRaises
(
BadRequest
,
om
.
_setObject
,
'REQUEST'
,
si
)
self
.
assertRaises
(
BadRequest
,
om
.
_setObject
,
'/'
,
si
)
self
.
assertRaises
(
BadRequest
,
om
.
_setObject
,
'@@view'
,
si
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment