fix trafic upload error when downloaded = 0

This commit is contained in:
xiaomlove
2022-12-14 16:10:47 +08:00
parent a39067021c
commit e8cdba638e
2 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.33');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-12-08');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-12-14');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
+10 -3
View File
@@ -523,9 +523,16 @@ if ($action == "exchange") {
}
//=== trade for upload
if($art == "traffic") {
if ($CURUSER['uploaded'] > $dlamountlimit_bonus * 1073741824)//uploaded amount reach limit
$ratio = $CURUSER['uploaded']/$CURUSER['downloaded'];
else $ratio = 0;
if ($CURUSER['uploaded'] > $dlamountlimit_bonus * 1073741824) {
//uploaded amount reach limit
if ($CURUSER['downloaded'] > 0) {
$ratio = $CURUSER['uploaded']/$CURUSER['downloaded'];
} else {
$ratio = PHP_INT_MAX;
}
} else {
$ratio = 0;
}
if ($ratiolimit_bonus > 0 && $ratio > $ratiolimit_bonus)
die($lang_mybonus['text_cheat_alert']);
else {