summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-02-19 19:08:28 +0100
committerVincent Petry <pvince81@owncloud.com>2014-02-20 10:40:10 +0100
commitb060a17b59f7117a670f09550215cb005dd822bc (patch)
tree4c6cd327445c955699abf3438c1a8ffaf6e5dbcf /apps/files_external/lib
parent952584e9c782d196eb2bcd6df1e3ecdf21adcb55 (diff)
downloadnextcloud-server-b060a17b59f7117a670f09550215cb005dd822bc.tar.gz
nextcloud-server-b060a17b59f7117a670f09550215cb005dd822bc.zip
Added extra checks for ext storage class
Diffstat (limited to 'apps/files_external/lib')
-rwxr-xr-xapps/files_external/lib/config.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 94dc5fb7ad8..cd3e7f3a4a6 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -277,15 +277,21 @@ class OC_Mount_Config {
$mountType,
$applicable,
$isPersonal = false) {
+ $backends = self::getBackends();
$mountPoint = OC\Files\Filesystem::normalizePath($mountPoint);
if ($mountPoint === '' || $mountPoint === '/' || $mountPoint == '/Shared') {
// can't mount at root or "Shared" folder
return false;
}
+
+ if (!isset($backends[$class])) {
+ // invalid backend
+ return false;
+ }
if ($isPersonal) {
// Verify that the mount point applies for the current user
// Prevent non-admin users from mounting local storage
- if ($applicable != OCP\User::getUser() || $class == '\OC\Files\Storage\Local') {
+ if ($applicable !== OCP\User::getUser() || strtolower($class) === '\oc\files\storage\local') {
return false;
}
$mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/');