isPathSafe

fnbool isPathSafe(string path, bool allowTraversal = false) @safe pure

Check 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

pathThe path to validate.
allowTraversalWhether to allow ".." components.

Returns

true if the path is safe for extraction.