validate_file ( $file, $allowed_files = array() )
- (string) file File path.
- (string) allowed_files Optional. Array of allowed files.
- (int) 0 means nothing is wrong, greater than 0 means something was wrong.
- Introduced in WordPress: 1.2.0
- Deprecated in WordPress: —
Validates a file name and path against an allowed set of rules.A return value of `1` means the file path contains directory traversal.
A return value of `2` means the file path contains a Windows drive path.
A return value of `3` means the file is not in the allowed files list.