From de1014dbb0282a4dd51fa334a11b35e19ab3cddc Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 16 Dec 2007 21:44:48 +0000 Subject: [PATCH] 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 --- wp-app.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-app.php b/wp-app.php index b47ee21da..2791ee726 100644 --- a/wp-app.php +++ b/wp-app.php @@ -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);