WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/07/2014 08:32:22 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Check for [\r\n\t ] instead of \s in sanitize_file_name() to avoid UTF-8 issues.

props p_enrique.
fixes #26094.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r29707 r29715  
    10551055    $special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );
    10561056    $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
    1057     $filename = str_replace($special_chars, '', $filename);
     1057    $filename = str_replace( $special_chars, '', $filename );
    10581058    $filename = str_replace( array( '%20', '+' ), '-', $filename );
    1059     $filename = preg_replace('/[\s-]+/', '-', $filename);
    1060     $filename = trim($filename, '.-_');
     1059    $filename = preg_replace( '/[\r\n\t -]+/', '-', $filename );
     1060    $filename = trim( $filename, '.-_' );
    10611061
    10621062    // Split the filename into a base and extension[s]
Note: See TracChangeset for help on using the changeset viewer.