From 3a7a860c6d77147dd24c0fc2edc6531a5fd8fdc6 Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 20 Mar 2018 15:54:19 +0100 Subject: [PATCH] Validate password in 'changePasswordForUserByUsername' for consistency --- src/Administration.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Administration.php b/src/Administration.php index 2f9ef0d..8a69919 100644 --- a/src/Administration.php +++ b/src/Administration.php @@ -378,9 +378,12 @@ final class Administration extends UserManager { * @param string $newPassword the new password to set * @throws UnknownUsernameException if no user with the specified username has been found * @throws AmbiguousUsernameException if multiple users with the specified username have been found + * @throws InvalidPasswordException if the desired new password has been invalid * @throws AuthError if an internal problem occurred (do *not* catch) */ public function changePasswordForUserByUsername($username, $newPassword) { + $newPassword = self::validatePassword($newPassword); + $userData = $this->getUserDataByUsername( \trim($username), [ 'id' ]