]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow using '/' as external storage root 3438/head
authorRobin Appelman <robin@icewind.nl>
Fri, 10 Feb 2017 12:29:18 +0000 (13:29 +0100)
committerRobin Appelman <robin@icewind.nl>
Thu, 23 Mar 2017 13:03:22 +0000 (14:03 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/files_external/js/settings.js
apps/files_external/lib/Controller/StoragesController.php

index 976c0c00b891dbd5ef3e491fa30cdde9f654d964..4e35ea531eb6fbf864132109b1ab68c2ff956aa4 100644 (file)
@@ -960,7 +960,7 @@ MountConfigListView.prototype = _.extend({
                        success: function(result) {
                                var onCompletion = jQuery.Deferred();
                                $.each(result, function(i, storageParams) {
-                                       storageParams.mountPoint = storageParams.mountPoint.substr(1); // trim leading slash
+                                       storageParams.mountPoint = (storageParams.mountPoint === '/')? '/' : storageParams.mountPoint.substr(1); // trim leading slash
                                        var storageConfig = new self._storageConfigClass();
                                        _.extend(storageConfig, storageParams);
                                        var $tr = self.newStorage(storageConfig, onCompletion);
index ef7cc8c6e4f043dc9a93528142709a9c5732f9ca..d962848bd7888b35b3cd0fb3a664aa1f637baaf2 100644 (file)
@@ -143,7 +143,7 @@ abstract class StoragesController extends Controller {
         */
        protected function validate(StorageConfig $storage) {
                $mountPoint = $storage->getMountPoint();
-               if ($mountPoint === '' || $mountPoint === '/') {
+               if ($mountPoint === '') {
                        return new DataResponse(
                                array(
                                        'message' => (string)$this->l10n->t('Invalid mount point')