diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-09-23 20:08:45 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-09-24 18:42:06 +0200 |
commit | 152fc7d94d71c178079388eaeb38c3e4b40fe080 (patch) | |
tree | 2aca40872771706d8030ab18455f5108d3d4f264 /files | |
parent | ef07b599cbe06bc6111ebc5584a18f75a0ca89a2 (diff) | |
download | nextcloud-server-152fc7d94d71c178079388eaeb38c3e4b40fe080.tar.gz nextcloud-server-152fc7d94d71c178079388eaeb38c3e4b40fe080.zip |
files: fix max filesize check
php check both, upload_max_filesize and post_max_size, when uploading a
file so we should do the same when figuring out the maximum size.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'files')
-rw-r--r-- | files/admin.php | 4 | ||||
-rw-r--r-- | files/index.php | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/files/admin.php b/files/admin.php index 09237dfc1d5..861b6037f3c 100644 --- a/files/admin.php +++ b/files/admin.php @@ -32,7 +32,9 @@ if(isset($_POST['maxUploadSize'])){ $maxUploadFilesize=$_POST['maxUploadSize']; OC_Files::setUploadLimit(OC_Helper::computerFileSize($maxUploadFilesize)); }else{ - $maxUploadFilesize = ini_get('upload_max_filesize').'B'; + $upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize')); + $post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size')); + $maxUploadFilesize = min($upload_max_filesize, $post_max_size); } OC_App::setActiveNavigationEntry( "files_administration" ); diff --git a/files/index.php b/files/index.php index bba8dc4951e..aa081d48804 100644 --- a/files/index.php +++ b/files/index.php @@ -78,7 +78,9 @@ $breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" ); $breadcrumbNav->assign( "breadcrumb", $breadcrumb ); $breadcrumbNav->assign( "baseURL", OC_Helper::linkTo("files", "index.php?dir=")); -$maxUploadFilesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize')); +$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize')); +$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size')); +$maxUploadFilesize = min($upload_max_filesize, $post_max_size); $tmpl = new OC_Template( "files", "index", "user" ); $tmpl->assign( "fileList", $list->fetchPage() ); |