]> git.mxchange.org Git - friendica.git/blobdiff - update.php
remove comment
[friendica.git] / update.php
index 0cbc0302fd4ae78c11d3bfa01794877079040376..bc14b3a29fbbca7b2a317d8d5a9a8fa3baced7ea 100644 (file)
@@ -149,9 +149,12 @@ function update_1203() {
 }
 
 function update_1244() {
+       // Sets legacy_password for all legacy hashes
+       dba::update('user', ['legacy_password' => true], ['SUBSTR(password, 1, 4) != "$2y$"']);
+
        // All legacy hashes are re-hashed using the new secure hashing function
-       $stmt = dba::select('user', ['uid', 'password'], ['password NOT LIKE "$%"']);
-       while ($user = dba::fetch($stmt)) {
+       $stmt = dba::select('user', ['uid', 'password'], ['legacy_password' => true]);
+       while($user = dba::fetch($stmt)) {
                dba::update('user', ['password' => User::hashPassword($user['password'])], ['uid' => $user['uid']]);
        }