diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-10-10 16:58:11 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-10-10 16:58:11 +0200 |
commit | 92009c5d8eb48d8ea89ab6ee803d8a47a7ff98c0 (patch) | |
tree | 29d0451f40197de57b0230e9e5078accdc0725df | |
parent | bb3b38947d2b012b4fef0cdd32f62524b2c5898c (diff) | |
download | nextcloud-server-92009c5d8eb48d8ea89ab6ee803d8a47a7ff98c0.tar.gz nextcloud-server-92009c5d8eb48d8ea89ab6ee803d8a47a7ff98c0.zip |
fix getVersions() for sub directories
-rw-r--r-- | apps/files_versions/lib/versions.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 5b291dfa10b..8151324696f 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -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; |