diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2016-05-17 17:27:33 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-02 15:47:12 +0200 |
commit | d82df7e4900dc8e9d492610cc82df102e4e18e3c (patch) | |
tree | 61c2824bdca1c15115d5ab690e0f9b54def76478 /apps/files_versions | |
parent | 3ff2bec5faaeddf47e95b4e4b395be7c709649b1 (diff) | |
download | nextcloud-server-d82df7e4900dc8e9d492610cc82df102e4e18e3c.tar.gz nextcloud-server-d82df7e4900dc8e9d492610cc82df102e4e18e3c.zip |
Construct path to the version file from the current directory and filename. Fixes #22450
Diffstat (limited to 'apps/files_versions')
-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 ca50c85c88d..638a1916f6a 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -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); } |