From a18368bf3f6b2a43a0bc4b59021f05a4ddb4eec5 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Fri, 14 Sep 2007 21:13:23 +0000 Subject: [PATCH] Properly name files with unknown extensions (for people with unfiltered_upload cap, natch). props Nazgul. fixes #4974 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@6116 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/file.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 027b8c4f4b..7f79eb41ec 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -140,7 +140,7 @@ function wp_handle_upload( &$file, $overrides = false ) { return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); if ( !$ext ) - $ext = strrchr($file['name'], '.'); + $ext = ltrim(strrchr($file['name'], '.'), '.'); } // A writable uploads dir will pass this test. Again, there's no point overriding this one.