Merge pull request #25039 from owncloud/stable9-construct-path
[Stable9] Construct path to the version file from the current directory and fil…
This commit is contained in:
commit
251a24b0cb
|
@ -532,13 +532,15 @@ class Storage {
|
||||||
$files = $view->getDirectoryContent($dir);
|
$files = $view->getDirectoryContent($dir);
|
||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
|
$fileData = $file->getData();
|
||||||
|
$filePath = $dir . '/' . $fileData['name'];
|
||||||
if ($file['type'] === 'dir') {
|
if ($file['type'] === 'dir') {
|
||||||
array_push($dirs, $file['path']);
|
array_push($dirs, $filePath);
|
||||||
} else {
|
} else {
|
||||||
$versionsBegin = strrpos($file['path'], '.v');
|
$versionsBegin = strrpos($filePath, '.v');
|
||||||
$relPathStart = strlen(self::VERSIONS_ROOT);
|
$relPathStart = strlen(self::VERSIONS_ROOT);
|
||||||
$version = substr($file['path'], $versionsBegin + 2);
|
$version = substr($filePath, $versionsBegin + 2);
|
||||||
$relpath = substr($file['path'], $relPathStart, $versionsBegin - $relPathStart);
|
$relpath = substr($filePath, $relPathStart, $versionsBegin - $relPathStart);
|
||||||
$key = $version . '#' . $relpath;
|
$key = $version . '#' . $relpath;
|
||||||
$versions[$key] = array('path' => $relpath, 'timestamp' => $version);
|
$versions[$key] = array('path' => $relpath, 'timestamp' => $version);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue