Subversion Repositories vgwhois

Compare Revisions

Regard whitespace Rev 96 → Rev 97

/trunk/shared/php_includes/ipv4_functions.inc.php
2,8 → 2,8
 
/*
* IPv4 functions for PHP
* Copyright 2012-2021 Daniel Marschall, ViaThinkSoft
* Version 2021-05-21
* Copyright 2012-2022 Daniel Marschall, ViaThinkSoft
* Version 2022-09-22
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
401,11 → 401,8
$rng = ipv4_cidr2range($line);
} else {
$rng = explode('-', $line);
$rng[0] = trim($rng[0]);
$rng[1] = trim($rng[1]);
$rng[0] = ipv4_normalize($rng[0]);
if (!isset($rng[1])) $rng[1] = $rng[0];
$rng[1] = ipv4_normalize($rng[1]);
$rng[0] = ipv4_normalize(trim($rng[0]));
$rng[1] = isset($rng[1]) ? ipv4_normalize(trim($rng[1])) : $rng[0];
}
 
return $rng;
565,10 → 562,7
if (strlen($bin) != 128) {
return false;
}
$pad = 128 - strlen($bin);
for ($i = 1; $i <= $pad; $i++) {
$bin = '0'.$bin;
}
//$bin = str_pad($bin, 128, '0', STR_PAD_LEFT);
$bits = 0;
$ipv6 = ''; # added by vts to avoid warning
while ($bits <= 7) {