diff options
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index b00c97f0dd3..f0b89ab5d47 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1331,6 +1331,9 @@ class ShareAPIController extends OCSController { } if ($token !== null) { + if (!$this->shareManager->allowCustomTokens()) { + throw new OCSForbiddenException($this->l->t('Custom share link tokens have been disabled by the administrator')); + } if (!$this->validateToken($token)) { throw new OCSBadRequestException($this->l->t('Tokens must contain at least 1 character and may only contain letters, numbers, or a hyphen')); } |