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:
parent
3fffac7d5d
commit
4a33d268ab
|
@ -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