diff options
author | Ermal <eri@pfsense.org> | 2011-05-06 20:35:32 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-05-06 20:36:05 +0000 |
commit | ac655e1b35b0c45d5ca7cb8da6a4350142b8a5aa (patch) | |
tree | d6cae2313d00fea33628854ebedb0ca5e1078221 /usr/local/captiveportal | |
parent | 6f5ed6f028af5ba5f142620e7770e1138a1b1d01 (diff) | |
download | pfsense-ac655e1b35b0c45d5ca7cb8da6a4350142b8a5aa.zip pfsense-ac655e1b35b0c45d5ca7cb8da6a4350142b8a5aa.tar.gz |
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.
Diffstat (limited to 'usr/local/captiveportal')
-rw-r--r-- | usr/local/captiveportal/radius_accounting.inc | 4 |
1 files 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; |