Fix used space calculation if shared folder does not exist, fixes bug oc-1331
Conflicts: settings/personal.php
This commit is contained in:
parent
f328f53ec1
commit
164fc1c981
|
@ -18,7 +18,12 @@ OC_App::setActiveNavigationEntry( 'personal' );
|
||||||
// calculate the disc space
|
// calculate the disc space
|
||||||
$rootInfo=OC_FileCache::get('');
|
$rootInfo=OC_FileCache::get('');
|
||||||
$sharedInfo=OC_FileCache::get('/Shared');
|
$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();
|
$free=OC_Filesystem::free_space();
|
||||||
$total=$free+$used;
|
$total=$free+$used;
|
||||||
if($total==0) $total=1; // prevent division by zero
|
if($total==0) $total=1; // prevent division by zero
|
||||||
|
|
Loading…
Reference in New Issue