Strip percent signs when sanitizing filenames so the server doesn't try to decode entities. Props filosofo. fixes #5587 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@7631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-04-08 17:22:20 +00:00
parent 3fffac7d5d
commit 4a33d268ab
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" )