MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / isValidRelativePath

Method isValidRelativePath

src/Content/ContentManager.py:597–603  ·  view source on GitHub ↗
(self, relative_path)

Source from the content-addressed store, hash-verified

595 return back
596
597 def isValidRelativePath(self, relative_path):
598 if ".." in relative_path.replace("\\", "/").split("/"):
599 return False
600 elif len(relative_path) > 255:
601 return False
602 else:
603 return re.match(r"^[a-z\[\]\(\) A-Z0-9~_@=\.\+-/]+$", relative_path)
604
605 def sanitizePath(self, inner_path):
606 return re.sub("[^a-z\[\]\(\) A-Z0-9_@=\.\+-/]", "", inner_path)

Callers 2

hashFilesMethod · 0.95
verifyContentMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected