diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2016-05-17 17:27:33 +0300 |
---|---|---|
committer | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2016-06-08 20:32:51 +0300 |
commit | f5d83e85b7c3ed52440750888439c257c94c4854 (patch) | |
tree | 8bbd343062a5a2879efaff6fcf35d967376cf988 /apps | |
parent | 7f3f06cdd9f6ae8c27a96bd5bfd81482c404c511 (diff) | |
download | nextcloud-server-f5d83e85b7c3ed52440750888439c257c94c4854.tar.gz nextcloud-server-f5d83e85b7c3ed52440750888439c257c94c4854.zip |
Construct path to the version file from the current directory and filename. Fixes #22450
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_versions/lib/storage.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php index 3c23f2f730a..a1069410e70 100644 --- a/apps/files_versions/lib/storage.php +++ b/apps/files_versions/lib/storage.php @@ -532,13 +532,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); } |