From 63202c0f73425f50d51ca691738950817ff97531 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg 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: https://develop.svn.wordpress.org/trunk@4388 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 3ff4d66e9e..49a4aa76f8 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; ?>

- + () + +