Strip percent signs when sanitizing filenames so the server doesn't try to decode entities. Props filosofo. fixes #5587 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@7631 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8f8bffd373
commit
f9290af15d
@ -1142,7 +1142,8 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL )
|
||||
$ext = strtolower( ".$ext" );
|
||||
|
||||
$filename = str_replace( $ext, '', $filename );
|
||||
$filename = sanitize_title_with_dashes( $filename ) . $ext;
|
||||
// Strip % so the server doesn't try to decode entities.
|
||||
$filename = str_replace('%', '', sanitize_title_with_dashes( $filename ) ) . $ext;
|
||||
|
||||
while ( file_exists( $dir . "/$filename" ) ) {
|
||||
if ( '' == "$number$ext" )
|
||||
|
Loading…
Reference in New Issue
Block a user