I believe the bug is in lib/api_automation.php's automation_get_valid_mask($range) function.
It uses bindec() to convert binary to integer, but the result of bindec() is unsigned integer, or float if it's too big for an integer[1]. On 32bit turns out it's too big for an integer, a float is returned, and things break.
Same code on 32bits:
ubuntu@f1-armhf:~$ php ./test.php 24
bindec(11111111111111111111111100000000):
4294967040PHP Warning: long2ip() expects parameter 1 to be int, float given in /home/ubuntu/test.php on line 13
I believe the bug is in lib/api_ automation. php's automation_ get_valid_ mask($range) function.
It uses bindec() to convert binary to integer, but the result of bindec() is unsigned integer, or float if it's too big for an integer[1]. On 32bit turns out it's too big for an integer, a float is returned, and things break.
On 64bit:
php ./test.php 24
bindec( 111111111111111 111111111000000 00):
4294967040
Array
(
[cidr] => 24
[subnet] => 255.255.255.0
[count] => 255
)
Same code on 32bits:
ubuntu@f1-armhf:~$ php ./test.php 24
bindec( 111111111111111 111111111000000 00): test.php on line 13
4294967040PHP Warning: long2ip() expects parameter 1 to be int, float given in /home/ubuntu/
Array
(
[cidr] => 24
[subnet] =>
[count] => 255
)
1. https:/ /www.php. net/manual/ en/function. bindec. php