From d4bdb2dc1924e2753baa4cf1751acb08b6ed3cae Mon Sep 17 00:00:00 2001 From: Sean Murphy Date: Thu, 5 Feb 2009 15:01:44 -0500 Subject: Better fix for displaying max file size. --- lib/imagefile.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/imagefile.php') diff --git a/lib/imagefile.php b/lib/imagefile.php index f9f47a47e..74c3d14f0 100644 --- a/lib/imagefile.php +++ b/lib/imagefile.php @@ -183,9 +183,14 @@ class ImageFile @unlink($this->filename); } - static function maxFileSize() + static function maxFileSize($return_bytes = false) { - $limit = min(ImageFile::strToInt(ini_get('post_max_size')), ImageFile::strToInt(ini_get('upload_max_filesize'))); + $limit = min(ImageFile::strToInt(ini_get('post_max_size')), ImageFile::strToInt(ini_get('upload_max_filesize')), ImageFile::strToInt(ini_get('memory_limit'))); + + if ($return_bytes) { + return $limit; + } + return ($limit/(1024*1024)).'MB'; } -- cgit v1.2.3-54-g00ecf