function sanitize_file_name( $filename ) { $filename_raw =
$filename;
$filename =
remove_accents( $filename );
$special_chars = array
( '?', '[', ']', '/', '\\', '=', '<', '>', ':', ';', ',', "'", '"', '&', '$', '#', '*', '(', ')', '|', '~', '`', '!', '{', '}', '%', '+', '’', '«', '»', '”', '“',
chr( 0
) );
// Check for support for utf8 in the installed PCRE library once and store the result in a static.
static $utf8_pcre = null;
if ( !
isset( $utf8_pcre ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
$utf8_pcre = @
preg_match( '/^./u', 'a'
);
} if ( !
seems_utf8( $filename ) ) {