Only call OC_FileCache::get('/Shared') if it exists in the file cache, prevents premature addition of the Shared folder to the file cache

remotes/origin/stable4
Michael Gapczynski 13 years ago
parent e43d02fadb
commit 6524f6ad30
  1. 7
      lib/fileproxy/quota.php

@ -55,7 +55,12 @@ class OC_FileProxy_Quota extends OC_FileProxy{
*/ */
private function getFreeSpace(){ private function getFreeSpace(){
$rootInfo=OC_FileCache::get(''); $rootInfo=OC_FileCache::get('');
$sharedInfo=OC_FileCache::get('/Shared'); // TODO Remove after merge of share_api
if (OC_FileCache::inCache('/Shared')) {
$sharedInfo=OC_FileCache::get('/Shared');
} else {
$sharedInfo = null;
}
$usedSpace=isset($rootInfo['size'])?$rootInfo['size']:0; $usedSpace=isset($rootInfo['size'])?$rootInfo['size']:0;
$usedSpace=isset($sharedInfo['size'])?$usedSpace-$sharedInfo['size']:$usedSpace; $usedSpace=isset($sharedInfo['size'])?$usedSpace-$sharedInfo['size']:$usedSpace;
$totalSpace=$this->getQuota(); $totalSpace=$this->getQuota();

Loading…
Cancel
Save