isPathSafe
fn
bool isPathSafe(string path, bool allowTraversal = false) @safe pureCheck if a path is safe for archive extraction.
Validates that a path does not contain path traversal sequences ("..") or other dangerous patterns that could cause files to be written outside the intended destination directory.
Parameters
path | The path to validate. |
allowTraversal | Whether to allow ".." components. |
Returns
true if the path is safe for extraction.