Tomaw
Tomaw

Reputation: 165

Special Character file upload WP Filebase Wordpress

I try to apply the function to sanitize file downloaded from the plugin WP Filebase In the functions.php file of my theme I included this

function make_san_filename($filename) {
    $info = pathinfo($filename);
    $ext  = empty($info['extension']) ? '' : '.' . $info['extension'];
    $name = str_replace($ext, '', $filename);
    return sanitize_title(strtolower($name)) . $ext;
}

add_filter('sanitize_file_name', 'make_san_filename', 10);

The function works perfectly with the files manager Wordpress, URLs of my files are clear, but the function does not work for the downloaded files with WP Filebase, so I can not replace the special characters in my URLs as : e + ® to  ...

Any idea or alternative ?

Upvotes: 1

Views: 792

Answers (0)

Related Questions