aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/LoginController.php13
-rw-r--r--core/Controller/LostController.php4
2 files changed, 16 insertions, 1 deletions
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
index fb60f0feccc..90c49549249 100644
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
@@ -336,9 +336,20 @@ class LoginController extends Controller {
);
}
+ $user = trim($user);
+
+ if (strlen($user) > 255) {
+ return $this->createLoginFailedResponse(
+ $user,
+ $user,
+ $redirect_url,
+ $this->l10n->t('Unsupported email length (>255)')
+ );
+ }
+
$data = new LoginData(
$this->request,
- trim($user),
+ $user,
$password,
$redirect_url,
$timezone,
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php
index 8e9a9e0f0de..d94386f9ab5 100644
--- a/core/Controller/LostController.php
+++ b/core/Controller/LostController.php
@@ -182,6 +182,10 @@ class LostController extends Controller {
$user = trim($user);
+ if (strlen($user) > 255) {
+ return new JSONResponse($this->error($this->l10n->t('Unsupported email length (>255)')));
+ }
+
\OCP\Util::emitHook(
'\OCA\Files_Sharing\API\Server2Server',
'preLoginNameUsedAsUserName',