From a06d901e3782a58f3f98bac4eca81430e56089ae Mon Sep 17 00:00:00 2001 From: Roland Hager Date: Thu, 13 Jun 2013 09:18:50 +0200 Subject: [PATCH] Fix: The check if upload_max_filesize or post_max_size is 0 fails if only one of them is 0. $upload_max_filesize and $post_max_size need to be casted to (int) to match "=== 0" --- lib/helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/helper.php b/lib/helper.php index a315c640d1..1860a55fc8 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -787,9 +787,9 @@ class OC_Helper { $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize')); $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size')); $freeSpace = \OC\Files\Filesystem::free_space($dir); - if ($upload_max_filesize == 0 and $post_max_size == 0) { + if ((int)$upload_max_filesize === 0 and (int)$post_max_size === 0) { $maxUploadFilesize = \OC\Files\FREE_SPACE_UNLIMITED; - } elseif ($upload_max_filesize === 0 or $post_max_size === 0) { + } elseif ((int)$upload_max_filesize === 0 or (int)$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);