]> source.dussan.org Git - nextcloud-server.git/commitdiff
Trim user earlier 37495/head
authorJosh Richards <josh.t.richards@gmail.com>
Tue, 4 Apr 2023 14:03:15 +0000 (10:03 -0400)
committerGitHub <noreply@github.com>
Tue, 4 Apr 2023 14:03:15 +0000 (10:03 -0400)
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
core/Controller/LostController.php

index 36b8dca6ddb606f62c3adef0d0c1ae1dc69639fd..51ab8d85a6eb75b093a7d146115f3eb1c5669eb9 100644 (file)
@@ -200,6 +200,8 @@ class LostController extends Controller {
                        return new JSONResponse($this->error($this->l10n->t('Password reset is disabled')));
                }
 
+               $user = trim($user);
+               
                \OCP\Util::emitHook(
                        '\OCA\Files_Sharing\API\Server2Server',
                        'preLoginNameUsedAsUserName',
@@ -208,7 +210,7 @@ class LostController extends Controller {
 
                // FIXME: use HTTP error codes
                try {
-                       $this->sendEmail(trim($user));
+                       $this->sendEmail($user);
                } catch (ResetPasswordException $e) {
                        // Ignore the error since we do not want to leak this info
                        $this->logger->warning('Could not send password reset email: ' . $e->getMessage());