Browse Source
Merge pull request #9372 from nextcloud/bugfix/4577
Do not allow folder creation with quota of 0
pull/9406/head
Morris Jobke
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
13 additions and
0 deletions
-
lib/private/Files/Storage/Wrapper/Quota.php
-
tests/lib/Files/Storage/Wrapper/QuotaTest.php
|
|
|
@ -200,4 +200,12 @@ class Quota extends Wrapper { |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function mkdir($path) { |
|
|
|
if ($this->quota === 0.0) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
return parent::mkdir($path); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -208,4 +208,9 @@ class QuotaTest extends \Test\Files\Storage\Storage { |
|
|
|
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Wrapper')); |
|
|
|
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota')); |
|
|
|
} |
|
|
|
|
|
|
|
public function testNoMkdirQuotaZero() { |
|
|
|
$instance = $this->getLimitedStorage(0.0); |
|
|
|
$this->assertFalse($instance->mkdir('foobar')); |
|
|
|
} |
|
|
|
} |