Allow using '/' as external storage root

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2017-02-10 13:29:18 +01:00
parent f38d36a161
commit 76d8699c0f
No known key found for this signature in database
GPG Key ID: CBCA68FBAEBF98C9
2 changed files with 2 additions and 2 deletions

View 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);

View 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')