]> source.dussan.org Git - nextcloud-server.git/commitdiff
prevend a division by zero problem
authorFrank Karlitschek <frank@owncloud.org>
Fri, 1 Jun 2012 14:48:42 +0000 (16:48 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Fri, 1 Jun 2012 14:48:42 +0000 (16:48 +0200)
settings/personal.php

index 41499657ac781fd65c23ce1402174e7125f5ef1c..64e08be89eb4b5d48494628f453fbfd9c0fe0eeb 100644 (file)
@@ -20,6 +20,7 @@ $rootInfo=OC_FileCache::get('');
 $used=$rootInfo['size'];
 $free=OC_Filesystem::free_space();
 $total=$free+$used;
+if($total==0) $total=1;  // prevent division by zero
 $relative=round(($used/$total)*10000)/100;
 
 $email=OC_Preferences::getValue(OC_User::getUser(), 'settings','email','');