summaryrefslogtreecommitdiffstats
path: root/wp-includes/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/functions.php')
-rw-r--r--wp-includes/functions.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 4399313..1a08fb8 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -1149,7 +1149,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" )