Rev4471, Allow files start with dot
This commit is contained in:
parent
1eec388252
commit
31d4304915
3 changed files with 4 additions and 2 deletions
|
@ -13,7 +13,7 @@ class Config(object):
|
|||
|
||||
def __init__(self, argv):
|
||||
self.version = "0.7.1"
|
||||
self.rev = 4469
|
||||
self.rev = 4471
|
||||
self.argv = argv
|
||||
self.action = None
|
||||
self.test_parser = None
|
||||
|
|
|
@ -599,7 +599,7 @@ class ContentManager(object):
|
|||
return False
|
||||
elif len(relative_path) > 255:
|
||||
return False
|
||||
elif relative_path[0] in (".", "/"): # Starts with
|
||||
elif relative_path[0] in ("/", "\\"): # Starts with
|
||||
return False
|
||||
elif relative_path[-1] in (".", " "): # Ends with
|
||||
return False
|
||||
|
|
|
@ -258,11 +258,13 @@ class TestContent:
|
|||
|
||||
assert not site.content_manager.isValidRelativePath("any\\hello.txt") # \ not allowed
|
||||
assert not site.content_manager.isValidRelativePath("/hello.txt") # Cannot start with /
|
||||
assert not site.content_manager.isValidRelativePath("\\hello.txt") # Cannot start with \
|
||||
assert not site.content_manager.isValidRelativePath("../hello.txt") # Not allowed .. in path
|
||||
assert not site.content_manager.isValidRelativePath("\0hello.txt") # NULL character
|
||||
assert not site.content_manager.isValidRelativePath("\31hello.txt") # 0-31 (ASCII control characters)
|
||||
assert not site.content_manager.isValidRelativePath("any/hello.txt ") # Cannot end with space
|
||||
assert not site.content_manager.isValidRelativePath("any/hello.txt.") # Cannot end with dot
|
||||
assert site.content_manager.isValidRelativePath(".hello.txt") # Allow start with dot
|
||||
assert not site.content_manager.isValidRelativePath("any/CON") # Protected names on Windows
|
||||
assert not site.content_manager.isValidRelativePath("CON/any.txt")
|
||||
assert not site.content_manager.isValidRelativePath("any/lpt1.txt")
|
||||
|
|
Loading…
Reference in a new issue