Skip to main content

safe_directory_identifier

Function safe_directory_identifier 

Source
pub fn safe_directory_identifier(identifier: &str) -> String
Expand description

Normalizes a user-supplied identifier for use in directory paths.

Replaces // with / and filters out empty segments and .. to prevent path traversal. Backslashes are normalized first so Windows separators cannot bypass the filter.