summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-03-03 16:48:28 +0100
committerRobin Appelman <icewind@owncloud.com>2014-03-03 16:48:28 +0100
commit06c6163265bf10e7aa84c2621d58323b3ad94963 (patch)
tree6e2037e72c07b0536b60edbae5347c839b428154
parentbb8a7a2230ce1b13ab97e1558a56f54009064066 (diff)
downloadnextcloud-server-06c6163265bf10e7aa84c2621d58323b3ad94963.tar.gz
nextcloud-server-06c6163265bf10e7aa84c2621d58323b3ad94963.zip
Check if fields we need are actually set to prevent errors
-rw-r--r--lib/private/files/cache/cache.php4
-rw-r--r--lib/private/files/cache/scanner.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php
index d886fd0fe76..abc11e76470 100644
--- a/lib/private/files/cache/cache.php
+++ b/lib/private/files/cache/cache.php
@@ -520,7 +520,7 @@ class Cache {
*/
public function calculateFolderSize($path, $entry = null) {
$totalSize = 0;
- if (is_null($entry)) {
+ if (is_null($entry) or !isset($entry['fileid'])) {
$entry = $this->get($path);
}
if ($entry && $entry['mimetype'] === 'httpd/unix-directory') {
@@ -544,7 +544,7 @@ class Cache {
if ($entry['size'] !== $totalSize) {
$update['size'] = $totalSize;
}
- if ($entry['unencrypted_size'] !== $unencryptedSum) {
+ if (!isset($entry['unencrypted_size']) or $entry['unencrypted_size'] !== $unencryptedSum) {
$update['unencrypted_size'] = $unencryptedSum;
}
if (count($update) > 0) {
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php
index ee6a828f7cc..79159724d16 100644
--- a/lib/private/files/cache/scanner.php
+++ b/lib/private/files/cache/scanner.php
@@ -155,7 +155,7 @@ class Scanner extends BasicEmitter {
}
}
if (!empty($newData)) {
- $this->cache->put($file, $newData);
+ $data['fileid'] = $this->cache->put($file, $newData);
$this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId));
\OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', array('path' => $file, 'storage' => $this->storageId));
}