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:
authorVincent Petry <pvince81@owncloud.com>2013-11-22 21:36:27 +0400
committerVincent Petry <pvince81@owncloud.com>2013-11-22 21:36:27 +0400
commit2d947835b94362982c98caba68aa1073ab466249 (patch)
tree5ebcbeb5bd6b86799d8fb12f39242912bd1c1789 /apps/files_external
parent476d8e6de073a095dda012079e7a6697e481c3c3 (diff)
Now also preventing the user of "Shared" as mountpoint
Diffstat (limited to 'apps/files_external')
-rwxr-xr-xapps/files_external/lib/config.php4
-rw-r--r--apps/files_external/tests/mountconfig.php2
2 files changed, 4 insertions, 2 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index de42fe2f755..aaa6c5be1a0 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -267,8 +267,8 @@ class OC_Mount_Config {
$applicable,
$isPersonal = false) {
$mountPoint = OC\Files\Filesystem::normalizePath($mountPoint);
- if ($mountPoint === '' || $mountPoint === '/') {
- // can't mount at root
+ if ($mountPoint === '' || $mountPoint === '/' || $mountPoint == '/Shared') {
+ // can't mount at root or "Shared" folder
return false;
}
if ($isPersonal) {
diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php
index 77241c4dd2a..941aec680bb 100644
--- a/apps/files_external/tests/mountconfig.php
+++ b/apps/files_external/tests/mountconfig.php
@@ -44,6 +44,8 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
$isPersonal = false;
$this->assertEquals(false, OC_Mount_Config::addMountPoint('', $storageClass, array(), $mountType, $applicable, $isPersonal));
$this->assertEquals(false, OC_Mount_Config::addMountPoint('/', $storageClass, array(), $mountType, $applicable, $isPersonal));
+ $this->assertEquals(false, OC_Mount_Config::addMountPoint('Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
+ $this->assertEquals(false, OC_Mount_Config::addMountPoint('/Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
}
}