Hotfix for password update

This commit is contained in:
Pinga 2025-02-19 14:11:44 +02:00
parent 955dd6ffe0
commit c923aaceb0
2 changed files with 10 additions and 6 deletions

View file

@ -312,9 +312,11 @@ class UsersController extends Controller
return $response->withHeader('Location', '/user/update/'.$old_username)->withStatus(302);
}
if (!checkPasswordComplexity($password)) {
$this->container->get('flash')->addMessage('error', 'Password too weak. Use a stronger password');
return $response->withHeader('Location', '/user/update/'.$old_username)->withStatus(302);
if (!empty($password)) {
if (!checkPasswordComplexity($password)) {
$this->container->get('flash')->addMessage('error', 'Password too weak. Use a stronger password');
return $response->withHeader('Location', '/user/update/'.$old_username)->withStatus(302);
}
}
// Check if username already exists (excluding the current user)