diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2012-08-08 11:29:44 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2012-08-08 11:29:44 +0200 |
commit | 0bf2a3e6d6a8059c6e3180fad2e9aa55438a9406 (patch) | |
tree | b2f704105e4ce1107987e4066ff47a9ff3a8a987 | |
parent | dc927bd346924f9247c55b484f7a008fe7252ee9 (diff) | |
download | nextcloud-server-0bf2a3e6d6a8059c6e3180fad2e9aa55438a9406.tar.gz nextcloud-server-0bf2a3e6d6a8059c6e3180fad2e9aa55438a9406.zip |
while loop not needed because of recursive call of put()
-rw-r--r-- | lib/filecache.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/filecache.php b/lib/filecache.php index 61470232ca3..e8b17e254e1 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -77,15 +77,11 @@ class OC_FileCache{ return; } - // add parent directories to the file cache if they does not exist yet. + // add parent directory to the file cache if it does not exist yet. if ($parent == -1 && $fullpath != $root) { - $dirparts = explode(DIRECTORY_SEPARATOR, dirname($path)); - $part = ''; - while ($parent == -1) { - self::scanFile( DIRECTORY_SEPARATOR.$part); - $parent = self::getParentId($fullpath); - $part = array_shift($dirparts); - } + $parentDir = substr(dirname($path), 0, strrpos(dirname($path), DIRECTORY_SEPARATOR)); + self::scanFile($parentDir); + $parent = self::getParentId($fullpath); } if(!isset($data['size']) or !isset($data['mtime'])){//save incomplete data for the next time we write it |