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

git-svn-id: https://develop.svn.wordpress.org/trunk@6393 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2007-12-16 21:44:48 +00:00
parent 36fe99d069
commit c750cbbf5f

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);