Skip to main content

sanitize_path_component

Function sanitize_path_component 

Source
pub fn sanitize_path_component(s: &str) -> String
Expand description

Sanitize a string for use as a single filesystem path component.

Removes path traversal sequences (.., /, \) and filters to alphanumeric characters plus -, _, and ..