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:
Ryan Boren 2008-04-08 17:22:20 +00:00
parent 8f8bffd373
commit f9290af15d
1 changed files with 2 additions and 1 deletions

View File

@ -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" )