aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2016-07-20 18:46:56 +0200
committerMichael Buesch <m@bues.ch>2016-07-20 18:46:56 +0200
commita0bfe0f65d572af797765e1331c3b1bb1f5dcd8e (patch)
tree7a60f5a3dc0a82153d89d91f51cef928fabe7fb4
parent3e4f08cd69424885f7a6aaa7dac0160da642b233 (diff)
downloadcms-testing.tar.xz
cms-testing.zip
Add exception descriptiontesting
Signed-off-by: Michael Buesch <m@bues.ch>
-rw-r--r--cms.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cms.py b/cms.py
index 537d8ff..c888031 100644
--- a/cms.py
+++ b/cms.py
@@ -178,9 +178,9 @@ class CMSPageIdent(list):
def validateSafePathComponent(cls, pcomp):
if pcomp.startswith('.'):
# No ".", ".." and hidden files.
- raise CMSException(404)
+ raise CMSException(404, "Invalid page path")
if [ c for c in pcomp if c not in cls.__validPathChars ]:
- raise CMSException(404)
+ raise CMSException(404, "Invalid page path")
return pcomp
# Validate a path. Avoid going back in the hierarchy (. and ..)
@@ -198,7 +198,7 @@ class CMSPageIdent(list):
def validateName(cls, name, allowSysNames = False):
if name.startswith("__") and not allowSysNames:
# Page names with __ are system folders.
- raise CMSException(404)
+ raise CMSException(404, "Invalid page name")
return cls.validateSafePathComponent(name)
def __init__(self, *args):
bues.ch cgit interface