From 612004c10ba23f8031b9697d190ab1a960eda516 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 24 Jul 2024 13:11:56 +0700 Subject: [PATCH] Fixed `md5()` deprecated in PHP 8.4 (#1561) * Fixed md5() deprecated for PHP 8.4 * Updated * Update CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ library/config.php | 4 ++-- src/Legacy/Common/User.php | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb582723d..2c699270b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # 📖 Change Log +## [v2.4.5](https://github.com/torrentpier/torrentpier/tree/v2.4.5) (2024-XX-XX) +[Full Changelog](https://github.com/torrentpier/torrentpier/compare/v2.4.4...v2.4.5) + +**Merged pull requests:** + +- Release 2.4.5 🦕 ([belomaxorka](https://github.com/belomaxorka)) +- Fixed `md5()` deprecated in PHP 8.4 [\#1561](https://github.com/torrentpier/torrentpier/pull/1561) ([belomaxorka](https://github.com/belomaxorka)) + ## [v2.4.4](https://github.com/torrentpier/torrentpier/tree/v2.4.4) (2024-07-22) [Full Changelog](https://github.com/torrentpier/torrentpier/compare/v2.4.3...v2.4.4) diff --git a/library/config.php b/library/config.php index 7398082a2..d46bfd283 100644 --- a/library/config.php +++ b/library/config.php @@ -21,8 +21,8 @@ $bb_cfg = []; $bb_cfg['js_ver'] = $bb_cfg['css_ver'] = 1; // Version info -$bb_cfg['tp_version'] = 'v2.4.4'; -$bb_cfg['tp_release_date'] = '22-07-2024'; +$bb_cfg['tp_version'] = 'v2.4.5-dev'; +$bb_cfg['tp_release_date'] = 'XX-XX-2024'; $bb_cfg['tp_release_codename'] = 'Cattle'; // Database diff --git a/src/Legacy/Common/User.php b/src/Legacy/Common/User.php index b907ca6d9..0b4ebe7e8 100644 --- a/src/Legacy/Common/User.php +++ b/src/Legacy/Common/User.php @@ -788,7 +788,7 @@ class User return true; } else { - if (md5(md5($enteredPassword)) === $userdata['user_password']) { + if (hash('md5', hash('md5', $enteredPassword)) === $userdata['user_password']) { // Update old md5 password DB()->query("UPDATE " . BB_USERS . " SET user_password = '" . $this->password_hash($enteredPassword) . "' WHERE user_id = '" . $userdata['user_id'] . "' AND user_password = '" . $userdata['user_password'] . "' LIMIT 1");