Fix used space calculation if shared folder does not exist, fixes bug oc-1331

Conflicts:
	settings/personal.php
This commit is contained in:
Michael Gapczynski 2012-07-26 10:30:14 -04:00
parent f328f53ec1
commit 164fc1c981
1 changed files with 69 additions and 64 deletions

View File

@ -18,7 +18,12 @@ OC_App::setActiveNavigationEntry( 'personal' );
// calculate the disc space
$rootInfo=OC_FileCache::get('');
$sharedInfo=OC_FileCache::get('/Shared');
$used=$rootInfo['size']-$sharedInfo['size'];
if (!isset($sharedInfo)) {
$sharedSize = 0;
} else {
$sharedSize = $sharedInfo['size'];
}
$used=$rootInfo['size']-$sharedSize;
$free=OC_Filesystem::free_space();
$total=$free+$used;
if($total==0) $total=1; // prevent division by zero