diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/filechunking.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/filechunking.php b/lib/private/filechunking.php index ece215e7344..32cbb7559f0 100644 --- a/lib/private/filechunking.php +++ b/lib/private/filechunking.php @@ -74,14 +74,16 @@ class OC_FileChunking { public function isComplete() { $prefix = $this->getPrefix(); - $parts = 0; $cache = $this->getCache(); - for($i=0; $i < $this->info['chunkcount']; $i++) { - if ($cache->hasKey($prefix.$i)) { - $parts ++; + $chunkcount = (int)$this->info['chunkcount']; + + for($i=($chunkcount-1); $i >= 0; $i--) { + if (!$cache->hasKey($prefix.$i)) { + return false; } } - return $parts == $this->info['chunkcount']; + + return true; } /** |