WordPress.org

Make WordPress Core

Ticket #6427: wp-unique-filename-behaviour-changes-r7553.patch

File wp-unique-filename-behaviour-changes-r7553.patch, 879 bytes (added by tellyworth, 6 years ago)
  • wordpress/wp-includes/functions.php

     
    11201120 
    11211121// return a filename that is sanitized and unique for the given directory 
    11221122function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL ) { 
    1123         $filename = strtolower( $filename ); 
    11241123        // separate the filename into a name and extension 
    11251124        $info = pathinfo($filename); 
    11261125        $ext = $info['extension']; 
     
    11411140                else 
    11421141                        $ext = strtolower( ".$ext" ); 
    11431142 
    1144                 $filename = str_replace( $ext, '', $filename ); 
    1145                 $filename = sanitize_title_with_dashes( $filename ) . $ext; 
     1143                $filename = sanitize_title_with_dashes( $name ) . $ext; 
    11461144 
    11471145                while ( file_exists( $dir . "/$filename" ) ) { 
    11481146                        if ( '' == "$number$ext" )