diff options
author | Simon Rettberg | 2018-03-28 15:36:08 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-03-28 15:36:08 +0200 |
commit | 597346717be97884410dbf851ebb4cbc1b12b148 (patch) | |
tree | b5594707dff33b7c37523f62d317a4d019d6a74b | |
parent | [locations] Handle statistics permissions when showing/linking machine stats (diff) | |
download | slx-admin-597346717be97884410dbf851ebb4cbc1b12b148.tar.gz slx-admin-597346717be97884410dbf851ebb4cbc1b12b148.tar.xz slx-admin-597346717be97884410dbf851ebb4cbc1b12b148.zip |
[dnbd3] Fix subnet to CIDR calculation on 32bit php :/
-rw-r--r-- | modules-available/dnbd3/inc/dnbd3util.inc.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules-available/dnbd3/inc/dnbd3util.inc.php b/modules-available/dnbd3/inc/dnbd3util.inc.php index 95b6ffe2..eaf4b128 100644 --- a/modules-available/dnbd3/inc/dnbd3util.inc.php +++ b/modules-available/dnbd3/inc/dnbd3util.inc.php @@ -188,7 +188,11 @@ class Dnbd3Util { */ private static function range2Cidr($start, $end) { - $bin = decbin((int)$start ^ (int)$end); + if (PHP_INT_SIZE > 4) { + $bin = decbin((int)$start ^ (int)$end); + } else { + $bin = decbin((int)(float)$start ^ (int)(float)$end); + } if ($bin === '0') return long2ip($start); $mask = 32 - strlen($bin); |