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:
Ryan Boren 2006-06-19 22:00:50 +00:00
parent 4b283b4c93
commit c0ad03e0c8
1 changed files with 2 additions and 1 deletions

View File

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