fix getVersions() for sub directories

This commit is contained in:
Bjoern Schiessle 2013-10-10 16:58:11 +02:00
parent bb3b38947d
commit 92009c5d8e

View file

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