From ac655e1b35b0c45d5ca7cb8da6a4350142b8a5aa Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 6 May 2011 20:35:32 +0000 Subject: Use the availble constant on php for this and also the right value that comes with it since PHP never supported u_int. There is a bug open still on PHP about bcmod but some more info is needed. --- usr/local/captiveportal/radius_accounting.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/local/captiveportal/radius_accounting.inc b/usr/local/captiveportal/radius_accounting.inc index 67bb523..2e18979 100644 --- a/usr/local/captiveportal/radius_accounting.inc +++ b/usr/local/captiveportal/radius_accounting.inc @@ -294,7 +294,7 @@ function gigawords($bytes) { */ // We use BCMath functions since normal integers don't work with so large numbers - $gigawords = bcdiv( bcsub( $bytes, remainder($bytes) ) , 4294967295) ; + $gigawords = bcdiv( bcsub( $bytes, remainder($bytes) ) , PHP_INT_MAX) ; // We need to manually set this to a zero instead of NULL for put_int() safety if (is_null($gigawords)) { @@ -308,7 +308,7 @@ function gigawords($bytes) { function remainder($bytes) { // Calculate the bytes we are going to send to the radius - $bytes = bcmod($bytes, 4294967295); + $bytes = bcmod($bytes, PHP_INT_MAX); if (is_null($bytes)) { $bytes = 0; -- cgit v1.1