From 98aa3b2dab82f823b2551bd071072bb47e7a9fb7 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 21 Jul 2023 15:18:41 -0400 Subject: [PATCH] Bump version to 3.0.223 --- wire/core/Password.php | 19 +++++++++++-------- wire/core/ProcessWire.php | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/wire/core/Password.php b/wire/core/Password.php index 83114665..d7bbea5e 100644 --- a/wire/core/Password.php +++ b/wire/core/Password.php @@ -56,8 +56,12 @@ class Password extends Wire { } if(strlen($hash) < 29) return false; - - $matches = ($hash === $this->data['hash']); + + if(function_exists("\\hash_equals")) { + $matches = hash_equals($this->data['hash'], $hash); + } else { + $matches = ($hash === $this->data['hash']); + } if($matches && $updateNotify) { $this->message($this->_('The password system has recently been updated. Please change your password to complete the update for your account.')); @@ -71,13 +75,13 @@ class Password extends Wire { * * #pw-group-internal * - * @param string $key + * @param string $name * @return mixed * */ - public function __get($key) { - if($key == 'salt' && !$this->data['salt']) $this->data['salt'] = $this->salt(); - return isset($this->data[$key]) ? $this->data[$key] : null; + public function __get($name) { + if($name === 'salt' && empty($this->data['salt'])) $this->data['salt'] = $this->salt(); + return isset($this->data[$name]) ? $this->data[$name] : null; } /** @@ -91,7 +95,7 @@ class Password extends Wire { */ public function __set($key, $value) { - if($key == 'pass') { + if($key === 'pass') { // setting the password $this->setPass($value); @@ -358,4 +362,3 @@ class Password extends Wire { } } - diff --git a/wire/core/ProcessWire.php b/wire/core/ProcessWire.php index 3ad8dfb0..00d2b2a9 100644 --- a/wire/core/ProcessWire.php +++ b/wire/core/ProcessWire.php @@ -79,7 +79,7 @@ class ProcessWire extends Wire { * Reversion revision number * */ - const versionRevision = 222; + const versionRevision = 223; /** * Version suffix string (when applicable)