openfl.utilities.path_check.is_directory_traversal#
- openfl.utilities.path_check.is_directory_traversal(directory)[source]#
Check for directory traversal.
This function checks if the provided directory is a subdirectory of the current working directory. It returns True if the directory is not a subdirectory (i.e., it is a directory traversal), and False otherwise.
- Parameters:
directory (Union[str, Path]) – The directory to check.
- Returns:
- True if the directory is a directory traversal, False
otherwise.
- Return type:
bool