Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-05-09 11:35:38 +0300
committerGitHub <noreply@github.com>2017-05-09 11:35:38 +0300
commit07fe15eea577e5844e95dd3b11bc41f8d0bbf14d (patch)
treeaf92cacf52c8f228e494472e2edc67a30a578394
parenta06ef70c8f7731d2e41cb10cf48fcb415d0207d0 (diff)
parentf8044cbbce7e19877754a27ae3d7a0716a67a3ae (diff)
Merge pull request #4705 from nextcloud/htaccess-upload
Proper exception for upload of .htaccess file via WebDAV
-rw-r--r--apps/files_versions/tests/VersioningTest.php24
-rw-r--r--lib/private/Files/View.php6
2 files changed, 17 insertions, 13 deletions
diff --git a/apps/files_versions/tests/VersioningTest.php b/apps/files_versions/tests/VersioningTest.php
index a1649b2b600..4cd202113dd 100644
--- a/apps/files_versions/tests/VersioningTest.php
+++ b/apps/files_versions/tests/VersioningTest.php
@@ -289,11 +289,11 @@ class VersioningTest extends \Test\TestCase {
$this->runCommands();
- $this->assertFalse($this->rootView->file_exists($v1));
- $this->assertFalse($this->rootView->file_exists($v2));
+ $this->assertFalse($this->rootView->file_exists($v1), 'version 1 of old file does not exist');
+ $this->assertFalse($this->rootView->file_exists($v2), 'version 2 of old file does not exist');
- $this->assertTrue($this->rootView->file_exists($v1Renamed));
- $this->assertTrue($this->rootView->file_exists($v2Renamed));
+ $this->assertTrue($this->rootView->file_exists($v1Renamed), 'version 1 of renamed file exists');
+ $this->assertTrue($this->rootView->file_exists($v2Renamed), 'version 2 of renamed file exists');
}
public function testRenameInSharedFolder() {
@@ -337,11 +337,11 @@ class VersioningTest extends \Test\TestCase {
self::loginHelper(self::TEST_VERSIONS_USER);
- $this->assertFalse($this->rootView->file_exists($v1));
- $this->assertFalse($this->rootView->file_exists($v2));
+ $this->assertFalse($this->rootView->file_exists($v1), 'version 1 of old file does not exist');
+ $this->assertFalse($this->rootView->file_exists($v2), 'version 2 of old file does not exist');
- $this->assertTrue($this->rootView->file_exists($v1Renamed));
- $this->assertTrue($this->rootView->file_exists($v2Renamed));
+ $this->assertTrue($this->rootView->file_exists($v1Renamed), 'version 1 of renamed file exists');
+ $this->assertTrue($this->rootView->file_exists($v2Renamed), 'version 2 of renamed file exists');
\OC::$server->getShareManager()->deleteShare($share);
}
@@ -553,11 +553,11 @@ class VersioningTest extends \Test\TestCase {
$this->runCommands();
- $this->assertTrue($this->rootView->file_exists($v1));
- $this->assertTrue($this->rootView->file_exists($v2));
+ $this->assertTrue($this->rootView->file_exists($v1), 'version 1 of original file exists');
+ $this->assertTrue($this->rootView->file_exists($v2), 'version 2 of original file exists');
- $this->assertTrue($this->rootView->file_exists($v1Copied));
- $this->assertTrue($this->rootView->file_exists($v2Copied));
+ $this->assertTrue($this->rootView->file_exists($v1Copied), 'version 1 of copied file exists');
+ $this->assertTrue($this->rootView->file_exists($v2Copied), 'version 2 of copied file exists');
}
/**
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 5e581feba6e..0e22415e6f7 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1081,7 +1081,11 @@ class View {
*/
public function free_space($path = '/') {
$this->assertPathLength($path);
- return $this->basicOperation('free_space', $path);
+ $result = $this->basicOperation('free_space', $path);
+ if ($result === null) {
+ throw new InvalidPathException();
+ }
+ return $result;
}
/**