diff --git a/src/Config.py b/src/Config.py index 2b5656a3..530d606e 100644 --- a/src/Config.py +++ b/src/Config.py @@ -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 diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index 6256a8cd..27da402b 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -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 diff --git a/src/Test/TestContent.py b/src/Test/TestContent.py index d46abc1f..7e7ca1a5 100644 --- a/src/Test/TestContent.py +++ b/src/Test/TestContent.py @@ -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")