From afb4c1e694b45810780b5ac17b7f35940c604e0c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 6 Jun 2016 13:48:38 +0200 Subject: [PATCH] Allow public upload when the quota is unlimited (#24988) --- apps/files_sharing/lib/controllers/sharecontroller.php | 2 +- lib/private/helper.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php index 838332b8c8329..982ce1154a3f1 100644 --- a/apps/files_sharing/lib/controllers/sharecontroller.php +++ b/apps/files_sharing/lib/controllers/sharecontroller.php @@ -314,7 +314,7 @@ public function showShare($token, $path = '') { * The OC_Util methods require a view. This just uses the node API */ $freeSpace = $share->getNode()->getStorage()->free_space($share->getNode()->getInternalPath()); - if ($freeSpace !== \OCP\Files\FileInfo::SPACE_UNKNOWN) { + if ($freeSpace < \OCP\Files\FileInfo::SPACE_UNLIMITED) { $freeSpace = max($freeSpace, 0); } else { $freeSpace = (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 diff --git a/lib/private/helper.php b/lib/private/helper.php index 70c50bb7b4b9a..7a17352024915 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -500,7 +500,7 @@ public static function maxUploadFilesize($dir, $freeSpace = null) { */ public static function freeSpace($dir) { $freeSpace = \OC\Files\Filesystem::free_space($dir); - if ($freeSpace !== \OCP\Files\FileInfo::SPACE_UNKNOWN) { + if ($freeSpace < \OCP\Files\FileInfo::SPACE_UNLIMITED) { $freeSpace = max($freeSpace, 0); return $freeSpace; } else {