fix getVersions() for sub directories

This commit is contained in:
Bjoern Schiessle 2013-10-10 16:58:11 +02:00
parent bb3b38947d
commit 92009c5d8e
1 changed files with 3 additions and 2 deletions

View File

@ -249,8 +249,9 @@ class Storage {
foreach ($files as $file) {
if ($file['type'] === 'file') {
$pos = strrpos($file['path'], '.v');
$length = $pos - strlen('files_versions/');
if (substr($file['path'], strlen('files_versions/'), $length) === $versionedFile) {
$length = $pos - strlen('files_versions/'.dirname($filename));
$currentFile = substr($file['name'], 0, strrpos($file['name'], '.v'));
if ($currentFile === $versionedFile) {
$version = substr($file['path'], $pos + 2);
$key = $version . '#' . $filename;
$versions[$key]['cur'] = 0;