diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-03-15 16:31:35 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-03-15 16:31:35 +0100 |
commit | 32b8fd8fb7a0deb1461820e6dcfdb6a0114ff980 (patch) | |
tree | 4d73ccba45c61d6c09f0b7e2bb7717a8019390f8 /lib/helper.php | |
parent | 761540e78b5e7ffc6cf717c71adcd8378b8f13a8 (diff) | |
download | nextcloud-server-32b8fd8fb7a0deb1461820e6dcfdb6a0114ff980.tar.gz nextcloud-server-32b8fd8fb7a0deb1461820e6dcfdb6a0114ff980.zip |
Improve handeling of unlimited max upload size
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/helper.php b/lib/helper.php index 41985ca57a7..6ee8a489164 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -764,7 +764,13 @@ class OC_Helper { public static function maxUploadFilesize($dir) { $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize')); $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size')); - $maxUploadFilesize = min($upload_max_filesize, $post_max_size); + if ($upload_max_filesize === 0 and $post_max_size === 0) { + $maxUploadFilesize = \OC\Files\FREE_SPACE_UNLIMITED; + } elseif ($upload_max_filesize === 0 or $post_max_size === 0) { + $maxUploadFilesize = max($upload_max_filesize, $post_max_size); //only the non 0 value counts + } else { + $maxUploadFilesize = min($upload_max_filesize, $post_max_size); + } $freeSpace = \OC\Files\Filesystem::free_space($dir); if($freeSpace !== \OC\Files\FREE_SPACE_UNKNOWN){ |