From 51851397fc9dd557c08775cca8201a99a6ed1f0e Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Tue, 21 Jan 2025 19:28:16 +0530 Subject: [PATCH] minor fix to return true --- lib/Service/RecoveryEmailService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Service/RecoveryEmailService.php b/lib/Service/RecoveryEmailService.php index 74a4f61..8ac6013 100644 --- a/lib/Service/RecoveryEmailService.php +++ b/lib/Service/RecoveryEmailService.php @@ -121,6 +121,9 @@ class RecoveryEmailService { return true; } public function validateRecoveryEmail(string $recoveryEmail, string $username = '', string $language = 'en'): bool { + if (empty($recoveryEmail)) { + return true; + } // Fetch user email if username is provided $email = $this->getUserEmail($username); @@ -155,9 +158,6 @@ class RecoveryEmailService { } private function enforceBasicRecoveryEmailRules(string $recoveryEmail, string $username, string $email, IL10N $l): void { - if (empty($recoveryEmail)) { - return; - } if (!$this->isValidEmailFormat($recoveryEmail)) { $this->logger->info("User $username's requested recovery email does not match email format"); -- GitLab