From 78293ea244e68cc0ebbebb4d8ccadc85fe9c0daa Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Fri, 24 Jun 2011 19:52:35 -0400 Subject: [PATCH] Better implementation of getting shared folder size by using the source path --- apps/files_sharing/sharedstorage.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php index 4e0089b2c0..b434331b9e 100644 --- a/apps/files_sharing/sharedstorage.php +++ b/apps/files_sharing/sharedstorage.php @@ -151,7 +151,8 @@ class OC_FILESTORAGE_SHARED { if ($path == "" || $path == "/") { $dbpath = $_SESSION['user_id']."/files/Share/"; } else { - $dbpath = substr(OC_SHARE::getSource($path), 1); + $source = OC_SHARE::getSource($path); + $dbpath = $this->getInternalPath($source); } $query = OC_DB::prepare("SELECT size FROM *PREFIX*foldersize WHERE path=?"); $size = $query->execute(array($dbpath))->fetchAll(); @@ -166,7 +167,7 @@ class OC_FILESTORAGE_SHARED { $size = 0; if ($dh = $this->opendir($path)) { while (($filename = readdir($dh)) != false) { - if ($this->is_file($filename)){ + if ($this->is_file($filename)) { $size += $this->filesize($filename); } else { $size += $this->getFolderSize($filename);