]> git.mxchange.org Git - friendica.git/commitdiff
Swap if / elseif
authorAlexandre Alapetite <alexandre@alapetite.fr>
Sun, 8 Apr 2018 14:02:25 +0000 (16:02 +0200)
committerAlexandre Alapetite <alexandre@alapetite.fr>
Sun, 8 Apr 2018 14:02:25 +0000 (16:02 +0200)
https://github.com/friendica/friendica/pull/4782#discussion_r179947984

src/Model/User.php

index 6178906aa278d5bdc0a192dba214139fbc01accb..27f7ff66f7ebc348b9e839a77d0e37462e508063 100644 (file)
@@ -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'));