WordPress.org

Make WordPress Core

Ticket #26094: 26094.3.patch

File 26094.3.patch, 602 bytes (added by p_enrique, 4 years ago)

use '/[\r\n\t -]+/' instead of '/[\s-]+/'

  • src/wp-includes/formatting.php

     
    873873         */
    874874        $special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );
    875875        $filename = str_replace($special_chars, '', $filename);
    876         $filename = preg_replace('/[\s-]+/', '-', $filename);
     876        $filename = preg_replace('/[\r\n\t -]+/', '-', $filename);
    877877        $filename = trim($filename, '.-_');
    878878
    879879        // Split the filename into a base and extension[s]