From acbe838c2307187a96b49e44df489f6b712b3798 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 4 Feb 2024 13:59:21 +0700 Subject: [PATCH] Fixed negative integer seed bonus accrual (#1377) * Fixed negative integer seed bonus accrual * Update CHANGELOG.md --- CHANGELOG.md | 1 + library/ajax/edit_user_profile.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecf6d52ef..5a1c9d0dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - Some enhancements in default template [\#1312](https://github.com/torrentpier/torrentpier/pull/1312) ([belomaxorka](https://github.com/belomaxorka)) - Some enhancements in default template (Part 2) [\#1322](https://github.com/torrentpier/torrentpier/pull/1322) ([belomaxorka](https://github.com/belomaxorka)) - Set response code in some cases [\#1319](https://github.com/torrentpier/torrentpier/pull/1319) ([belomaxorka](https://github.com/belomaxorka)) +- Fixed negative integer seed bonus accrual [\#1377](https://github.com/torrentpier/torrentpier/pull/1377) ([belomaxorka](https://github.com/belomaxorka)) - Fixed `admin_terms.php` textarea reset in preview mode [\#1371](https://github.com/torrentpier/torrentpier/pull/1371) ([belomaxorka](https://github.com/belomaxorka)) - Fixed broken user dl status [\#1351](https://github.com/torrentpier/torrentpier/pull/1351) ([belomaxorka](https://github.com/belomaxorka)) - Fixed: mb_strlen(): Passing null parameter [\#1374](https://github.com/torrentpier/torrentpier/pull/1374) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/library/ajax/edit_user_profile.php b/library/ajax/edit_user_profile.php index 4615e663c..2082477f5 100644 --- a/library/ajax/edit_user_profile.php +++ b/library/ajax/edit_user_profile.php @@ -145,7 +145,7 @@ switch ($field) { case 'user_points': $value = (float)str_replace(',', '.', $this->request['value']); $value = sprintf('%.2f', $value); - if (strlen(strstr($value, '.', true)) > 14) { + if ($value < 0.0 || strlen(strstr($value, '.', true)) > 14) { $this->ajax_die($lang['WRONG_INPUT']); } $this->response['new_value'] = $value;