]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix undefined variable for copying empty folders
authorMichael Gapczynski <mtgap@owncloud.com>
Sun, 19 May 2013 19:04:41 +0000 (15:04 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Sun, 19 May 2013 19:04:41 +0000 (15:04 -0400)
lib/files/view.php
tests/lib/files/view.php

index 875a6c1a1f86bfd2020477aeaa0772e55353bfa9..8a37a0bcc62f9a7869a286fbcfc92c92c8fa6c2b 100644 (file)
@@ -467,7 +467,7 @@ class View {
                                        }
                                } else {
                                        if ($this->is_dir($path1) && ($dh = $this->opendir($path1))) {
-                                               $this->mkdir($path2);
+                                               $result = $this->mkdir($path2);
                                                while ($file = readdir($dh)) {
                                                        if (!Filesystem::isIgnoredDir($file)) {
                                                                $result = $this->copy($path1 . '/' . $file, $path2 . '/' . $file);
index 554bc7291ad03f0eb6f0d85b7f4f85a5c8f893a5..a51d99e793d822e22b10376691b4bfef11a9b91d 100644 (file)
@@ -235,9 +235,12 @@ class View extends \PHPUnit_Framework_TestCase {
                \OC\Files\Filesystem::mount($storage2, array(), '/substorage');
 
                $rootView = new \OC\Files\View('');
+               $rootView->mkdir('substorage/emptyfolder');
                $rootView->copy('substorage', 'anotherfolder');
                $this->assertTrue($rootView->is_dir('/anotherfolder'));
                $this->assertTrue($rootView->is_dir('/substorage'));
+               $this->assertTrue($rootView->is_dir('/anotherfolder/emptyfolder'));
+               $this->assertTrue($rootView->is_dir('/substorage/emptyfolder'));
                $this->assertTrue($rootView->file_exists('/anotherfolder/foo.txt'));
                $this->assertTrue($rootView->file_exists('/anotherfolder/foo.png'));
                $this->assertTrue($rootView->file_exists('/anotherfolder/folder/bar.txt'));