mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
13ad107f4d
commit
de1014dbb0
@ -403,7 +403,7 @@ EOD;
|
|||||||
$slug = sanitize_file_name( $_SERVER['HTTP_TITLE'] );
|
$slug = sanitize_file_name( $_SERVER['HTTP_TITLE'] );
|
||||||
elseif ( empty( $slug ) ) // just make a random name
|
elseif ( empty( $slug ) ) // just make a random name
|
||||||
$slug = substr( md5( uniqid( microtime() ) ), 0, 7);
|
$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";
|
$slug = "$slug.$ext";
|
||||||
$file = wp_upload_bits( $slug, NULL, $bits);
|
$file = wp_upload_bits( $slug, NULL, $bits);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user