]> source.dussan.org Git - nextcloud-server.git/commitdiff
Construct path to the version file from the current directory and filename. Fixes...
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>
Tue, 17 May 2016 14:27:33 +0000 (17:27 +0300)
committerVincent Petry <pvince81@owncloud.com>
Thu, 2 Jun 2016 13:47:12 +0000 (15:47 +0200)
apps/files_versions/lib/Storage.php

index ca50c85c88db33daec2121a05e71e4952c7b546c..638a1916f6ab8226209ef225d24505f560b649a6 100644 (file)
@@ -531,13 +531,15 @@ class Storage {
                        $files = $view->getDirectoryContent($dir);
 
                        foreach ($files as $file) {
+                               $fileData = $file->getData();
+                               $filePath = $dir . '/' . $fileData['name'];
                                if ($file['type'] === 'dir') {
-                                       array_push($dirs, $file['path']);
+                                       array_push($dirs, $filePath);
                                } else {
-                                       $versionsBegin = strrpos($file['path'], '.v');
+                                       $versionsBegin = strrpos($filePath, '.v');
                                        $relPathStart = strlen(self::VERSIONS_ROOT);
-                                       $version = substr($file['path'], $versionsBegin + 2);
-                                       $relpath = substr($file['path'], $relPathStart, $versionsBegin - $relPathStart);
+                                       $version = substr($filePath, $versionsBegin + 2);
+                                       $relpath = substr($filePath, $relPathStart, $versionsBegin - $relPathStart);
                                        $key = $version . '#' . $relpath;
                                        $versions[$key] = array('path' => $relpath, 'timestamp' => $version);
                                }