From d3db27276421fec706451ca9dee31afa97621031 Mon Sep 17 00:00:00 2001 From: markjaquith 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: http://svn.automattic.com/wordpress/trunk@6116 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 027b8c4f4..7f79eb41e 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.