diff --git a/core/lib/Drupal/Core/Password/PhpPassword.php b/core/lib/Drupal/Core/Password/PhpPassword.php index fd29c3a..1f65dd4 100644 --- a/core/lib/Drupal/Core/Password/PhpPassword.php +++ b/core/lib/Drupal/Core/Password/PhpPassword.php @@ -93,6 +93,14 @@ public function check($password, UserInterface $account) { * {@inheritdoc} */ public function userNeedsNewHash(UserInterface $account) { + // The PHP 5.5 password_needs_rehash() will return TRUE in two cases: + // - The the password is Drupal 6 or 7 password and it has been rehashed + // during the migration. In this case the rehashed legacy hash is prefixed + // to indicate and old-Drupal hash and will not comply the expected + // password_needs_rehash() format. + // - The parameters of hashing engine were changed. For example the + // parameter 'password_hash_cost' (the hashing cost) has been increased in + // core.services.yml. return password_needs_rehash($account->getPassword(), PASSWORD_DEFAULT, $this->getOptions()); }