Browse Source

Construct path to the version file from the current directory and filename. Fixes #22450

tags/v9.0.1beta2
Victor Dubiniuk 8 years ago
parent
commit
d82df7e490
No account linked to committer's email address
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      apps/files_versions/lib/Storage.php

+ 6
- 4
apps/files_versions/lib/Storage.php View 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);
}

Loading…
Cancel
Save