Quantcast
Channel: WordPress.org Forums » [WP-Filebase Download Manager] Support
Viewing all articles
Browse latest Browse all 1341

Fabian on "[Plugin: WP-Filebase Download Manager] Bandwidth Limit daily/monthly not correctly working"

$
0
0

Hi,

here's patch to fix this issue:
(apply on classes/Download.php)

+++ Download.php	(working copy)
@@ -42,8 +42,8 @@
 {
 	$traffic = wpfb_call('Misc','GetTraffic');

-	$limit_month = (WPFB_Core::GetOpt('traffic_month') * 1048576);
-	$limit_day = (WPFB_Core::GetOpt('traffic_day') * 1073741824);
+	$limit_month = (WPFB_Core::GetOpt('traffic_month') * 1073741824); //GiB
+	$limit_day = (WPFB_Core::GetOpt('traffic_day') * 1048576); // MiB

 	return ( ($limit_month == 0 || ($traffic['month'] + $file_size) < $limit_month) && ($limit_day == 0 || ($traffic['today'] + $file_size) < $limit_day) );
 }

The numbers 1048576 (for MiB) and 1073741824 (for GiB) must be swapped.

Regards
Fabian


Viewing all articles
Browse latest Browse all 1341

Trending Articles