Allow numbers in content type to allow for types like 3gp. Fixes #5449. Hat tip: meledin, DD32.

git-svn-id: http://svn.automattic.com/wordpress/trunk@6393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2007-12-16 21:44:48 +00:00
parent 13ad107f4d
commit de1014dbb0
1 changed files with 1 additions and 1 deletions

View File

@ -403,7 +403,7 @@ EOD;
$slug = sanitize_file_name( $_SERVER['HTTP_TITLE'] );
elseif ( empty( $slug ) ) // just make a random name
$slug = substr( md5( uniqid( microtime() ) ), 0, 7);
$ext = preg_replace( '|.*/([a-z]+)|', '$1', $_SERVER['CONTENT_TYPE'] );
$ext = preg_replace( '|.*/([a-z0-9]+)|', '$1', $_SERVER['CONTENT_TYPE'] );
$slug = "$slug.$ext";
$file = wp_upload_bits( $slug, NULL, $bits);