Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
WordPress plugin that removes evil characters in file names
Plugin Name: Sunnytize
Plugin URI:
Description: A better file name sanitizer
Version: 1.0
Author: Sunny Ripert
Author URI:
function sunnytize_file_name_chars($special_chars, $filename_raw = '') {
return array_merge($special_chars, str_split('éè’ààäçéèêöôùûü£€%@+«»°'));
add_filter('sanitize_file_name_chars', 'sunnytize_file_name_chars');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment