WordPress sanitize and escape data
WordPress data validation Data Sanitization and Validation With WordPress For input: For output: sanitize_file_name( $filename ) – sanitizes (or validates) the file-name by removing characters that are illegal in filenames on certain operating systems or that would require escaping at the command line. Replaces spaces with dashes and consecutive dashes with a single dash and ... Read more