Make WordPress Core


Ignore:
Timestamp:
07/24/2014 10:08:09 PM (10 years ago)
Author:
wonderboymusic
Message:

In sanitize_file_name(), replace %20 and + with dashes. Remove unnecessary code from _wp_handle_upload().

Adds unit tests.

Props ericmann.
Fixes #16330.

File:
1 edited

Legend:

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

    r29163 r29290  
    10501050    $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
    10511051    $filename = str_replace($special_chars, '', $filename);
     1052    $filename = str_replace( array( '%20', '+' ), '-', $filename );
    10521053    $filename = preg_replace('/[\s-]+/', '-', $filename);
    10531054    $filename = trim($filename, '.-_');
Note: See TracChangeset for help on using the changeset viewer.