From: Alexandre Alapetite Date: Sun, 8 Apr 2018 14:02:25 +0000 (+0200) Subject: Swap if / elseif X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e860cdf6a8769c8441ed3dba33f192898c78ab40;p=friendica.git Swap if / elseif https://github.com/friendica/friendica/pull/4782#discussion_r179947984 --- diff --git a/src/Model/User.php b/src/Model/User.php index 6178906aa2..27f7ff66f7 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -127,18 +127,18 @@ class User { $user = self::getAuthenticationInfo($user_info); - if (password_verify($password, $user['password'])) { - if (password_needs_rehash($user['password'], PASSWORD_DEFAULT)) { - self::updatePassword($user['uid'], $password); - } - - return $user['uid']; - } elseif (strpos($user['password'], '$') === false) { + if (strpos($user['password'], '$') === false) { if (self::hashPasswordLegacy($password) === $user['password']) { self::updatePassword($user['uid'], $password); return $user['uid']; } + } elseif (password_verify($password, $user['password'])) { + if (password_needs_rehash($user['password'], PASSWORD_DEFAULT)) { + self::updatePassword($user['uid'], $password); + } + + return $user['uid']; } throw new Exception(L10n::t('Login failed'));