summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/lib/util.php6
-rw-r--r--lib/filecache.php8
2 files changed, 11 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/util.php b/apps/files_sharing/lib/util.php
index 2306408dc0e..a7422941c06 100644
--- a/apps/files_sharing/lib/util.php
+++ b/apps/files_sharing/lib/util.php
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* ownCloud
*
@@ -33,6 +33,10 @@ class OC_Files_Sharing_Util {
private static function getFile($target) {
$target = '/'.$target;
$target = rtrim($target, '/');
+ if ($target == NULL) {
+ return false;
+ }
+
if (isset(self::$files[$target])) {
return self::$files[$target];
} else {
diff --git a/lib/filecache.php b/lib/filecache.php
index 6ddb327660b..c7a4c63bded 100644
--- a/lib/filecache.php
+++ b/lib/filecache.php
@@ -348,9 +348,9 @@ class OC_FileCache{
/**
* adjust the size of the parent folders
- * @param string $path
+ * @param string $path root (optional)
* @param int $sizeDiff
- * @param string root (optinal)
+ * @param bool $root
*/
public static function increaseSize($path,$sizeDiff, $root=false) {
if($sizeDiff==0) return;
@@ -358,6 +358,10 @@ class OC_FileCache{
$path = '';
}
$item = OC_FileCache_Cached::get($path);
+ // not found? -> return
+ if ($item === false || !isset($item['mimetype'])) {
+ return;
+ }
//stop walking up the filetree if we hit a non-folder or reached to root folder
if($item['mimetype'] !== 'httpd/unix-directory'){
return;