]> source.dussan.org Git - nextcloud-server.git/commitdiff
make sure that the versions array contains the correct path
authorBjoern Schiessle <schiessle@owncloud.com>
Tue, 5 Aug 2014 15:25:55 +0000 (17:25 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Tue, 5 Aug 2014 15:25:55 +0000 (17:25 +0200)
apps/files_versions/lib/versions.php

index a9d51b2c58b644fc1ee50f0105075762a6c62ad9..7fadf81426bcd50ad3981230a61fac37e916940f 100644 (file)
@@ -265,7 +265,7 @@ class Storage {
                $pathinfo = pathinfo($filename);
                $versionedFile = $pathinfo['basename'];
 
-               $dir = self::VERSIONS_ROOT . '/' . $pathinfo['dirname'];
+               $dir = \OC\Files\Filesystem::normalizePath(self::VERSIONS_ROOT . '/' . $pathinfo['dirname']);
 
                $dirContent = false;
                if ($view->is_dir($dir)) {
@@ -293,7 +293,7 @@ class Storage {
                                                } else {
                                                        $versions[$key]['preview'] = \OCP\Util::linkToRoute('core_ajax_versions_preview', array('file' => $userFullPath, 'version' => $timestamp));
                                                }
-                                               $versions[$key]['path'] = $filename;
+                                               $versions[$key]['path'] = $pathinfo['dirname'] . '/' . $filename;
                                                $versions[$key]['name'] = $versionedFile;
                                                $versions[$key]['size'] = $view->filesize($dir . '/' . $entryName);
                                        }