fix getVersions() for sub directories
This commit is contained in:
parent
bb3b38947d
commit
92009c5d8e
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue