From 94fc4bdc610a34ca9a8cec12409482bd683bc189 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 13 Oct 2006 07:44:35 +0000 Subject: [PATCH] Don't let people upload files bigger than PHP will allow, and echo out the limit. This should be done for the inline uploader too (ping mdawaffe) git-svn-id: http://svn.automattic.com/wordpress/trunk@4388 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 3ff4d66e9..49a4aa76f 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1937,11 +1937,21 @@ function wp_import_cleanup($id) { } function wp_import_upload_form($action) { + $size = strtolower( ini_get('upload_max_filesize') ); + $bytes = 0; + if ( strstr( $size, 'k' ) ) + $bytes = $size * 1024; + if ( strstr( $size, 'm' ) ) + $bytes = $size * 1024 * 1024; + if ( strstr( $size, 'g' ) ) + $bytes = $size * 1024 * 1024 * 1024; ?>

- + () + +