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>
This commit is contained in:
parent
ef07b599cb
commit
152fc7d94d
2 changed files with 6 additions and 2 deletions
|
@ -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" );
|
||||
|
|
|
@ -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() );
|
||||
|
|
Loading…
Reference in a new issue