diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-09-08 18:28:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-08 18:28:36 +0300 |
commit | 1f06895b34eda00273496997f00192353a3f2b68 (patch) | |
tree | 3692f7f169343495427806f3d74e5bb8f58a8cee /plugins/Login | |
parent | 748154c5f118f03c7d70a0428f9551b01a09f8f2 (diff) |
Revert "Make password reset use a secure hash (#17961)" (#17983)
This reverts commit 7e82e80d7aa44714a412a0b6fd6cb53164b8ab6d.
Diffstat (limited to 'plugins/Login')
-rw-r--r-- | plugins/Login/PasswordResetter.php | 2 | ||||
-rw-r--r-- | plugins/Login/tests/Integration/PasswordResetterTest.php | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/plugins/Login/PasswordResetter.php b/plugins/Login/PasswordResetter.php index 666696fe4a..b71b846a1b 100644 --- a/plugins/Login/PasswordResetter.php +++ b/plugins/Login/PasswordResetter.php @@ -347,7 +347,7 @@ class PasswordResetter */ protected function hashData($data) { - return $this->passwordHelper->hash($data); + return Common::hash($data); } /** diff --git a/plugins/Login/tests/Integration/PasswordResetterTest.php b/plugins/Login/tests/Integration/PasswordResetterTest.php index e5fe872cf2..b6014aecff 100644 --- a/plugins/Login/tests/Integration/PasswordResetterTest.php +++ b/plugins/Login/tests/Integration/PasswordResetterTest.php @@ -195,8 +195,7 @@ class PasswordResetterTest extends IntegrationTestCase ['Test.Mail.send', \DI\value(function (PHPMailer $mail) { $body = $mail->createBody(); $body = preg_replace("/=[\r\n]+/", '', $body); - // This regex should include the range of characters Piwik\Auth\Password->hash() might return. - preg_match('/resetToken=[\s]*3D([^<]+)<\/p>/', $body, $matches); + preg_match('/resetToken=[\s]*3D([a-zA-Z0-9=\s]+)<\/p>/', $body, $matches); if (!empty($matches[1])) { $capturedToken = $matches[1]; $capturedToken = preg_replace('/=\s*/', '', $capturedToken); |