diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-01-19 10:17:29 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-01-20 21:12:26 +0100 |
commit | 894a88ca516c69304d902bb6a98c5bcdb15becea (patch) | |
tree | 00c115bf86cd0384185fe51de9668d3b08285df8 /apps | |
parent | 8734ebe505d621c355da0495e29692c56ca45226 (diff) | |
download | nextcloud-server-894a88ca516c69304d902bb6a98c5bcdb15becea.tar.gz nextcloud-server-894a88ca516c69304d902bb6a98c5bcdb15becea.zip |
[Share 2.0] Make public link work without view
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/controllers/sharecontroller.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php index 2342a092c64..f717dadf576 100644 --- a/apps/files_sharing/lib/controllers/sharecontroller.php +++ b/apps/files_sharing/lib/controllers/sharecontroller.php @@ -248,9 +248,20 @@ class ShareController extends Controller { // Show file list if ($share->getPath() instanceof \OCP\Files\Folder) { $shareTmpl['dir'] = $rootFolder->getRelativePath($path->getPath()); - $maxUploadFilesize = Util::maxUploadFilesize($share->getPath()->getPath()); - $freeSpace = Util::freeSpace($share->getPath()->getPath()); + + /* + * The OC_Util methods require a view. This just uses the node API + */ + $freeSpace = $share->getPath()->getStorage()->free_space($share->getPath()->getInternalPath()); + if ($freeSpace !== \OCP\Files\FileInfo::SPACE_UNKNOWN) { + $freeSpace = max($freeSpace, 0); + } else { + $freeSpace = (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 + } + $uploadLimit = Util::uploadLimit(); + $maxUploadFilesize = min($freeSpace, $uploadLimit); + $folder = new Template('files', 'list', ''); $folder->assign('dir', $rootFolder->getRelativePath($path->getPath())); $folder->assign('dirToken', $token); |