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

This commit is contained in:
Victor Dubiniuk 2016-05-17 17:27:33 +03:00
parent 7f3f06cdd9
commit f5d83e85b7
1 changed files with 6 additions and 4 deletions

View File

@ -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);
}