From 1edfe71da23463b47f79ad959348ba7964460384 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 19 Jun 2006 22:00:50 +0000 Subject: [PATCH] Filename sanitation from sanitation engineer skeltoac. fixes #2823 git-svn-id: http://svn.automattic.com/wordpress/trunk@3891 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index acd98abac..c3dbee020 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -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