Skip to content
Snippets Groups Projects
Commit 60d8046c authored by Vincent Petry's avatar Vincent Petry
Browse files

Fix uploading when free space is unlimited

A federated share can report unlimited quota as -3, so the
ajax/upload.php code needs to be adjusted to block uploads when the free
space is unlimited.
parent c07b7316
No related branches found
No related tags found
No related merge requests found
...@@ -138,7 +138,7 @@ $maxHumanFileSize = OCP\Util::humanFileSize($maxUploadFileSize); ...@@ -138,7 +138,7 @@ $maxHumanFileSize = OCP\Util::humanFileSize($maxUploadFileSize);
$totalSize = 0; $totalSize = 0;
$isReceivedShare = \OC::$server->getRequest()->getParam('isReceivedShare', false) === 'true'; $isReceivedShare = \OC::$server->getRequest()->getParam('isReceivedShare', false) === 'true';
// defer quota check for received shares // defer quota check for received shares
if (!$isReceivedShare) { if (!$isReceivedShare && $storageStats['freeSpace'] >= 0) {
foreach ($files['size'] as $size) { foreach ($files['size'] as $size) {
$totalSize += $size; $totalSize += $size;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment