Now also preventing the user of "Shared" as mountpoint

remotes/origin/stable6
Vincent Petry 12 years ago
parent 476d8e6de0
commit 2d947835b9
  1. 4
      apps/files_external/lib/config.php
  2. 2
      apps/files_external/tests/mountconfig.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) {

@ -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));
}
}

Loading…
Cancel
Save