Filename sanitation from sanitation engineer skeltoac. fixes #2823
git-svn-id: https://develop.svn.wordpress.org/trunk@3891 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4b283b4c93
commit
c0ad03e0c8
|
@ -1882,7 +1882,8 @@ function wp_handle_upload(&$file, $overrides = false) {
|
|||
else
|
||||
$filename = str_replace("$number$ext", ++$number . $ext, $filename);
|
||||
}
|
||||
$filename = preg_replace('#\.(?![^.]+$)#', '-', $filename);
|
||||
$filename = str_replace($ext, '', $filename);
|
||||
$filename = sanitize_title_with_dashes($filename) . $ext;
|
||||
}
|
||||
|
||||
// Move the file to the uploads dir
|
||||
|
|
Loading…
Reference in New Issue