Merge pull request #11 from simplerezo/master

Remove usage of each() (obsolete since PHP 7.2)
This commit is contained in:
David Saez Padros 2020-05-02 20:36:07 +02:00 committed by GitHub
commit 09fedcc114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 615 additions and 625 deletions

View File

@ -61,7 +61,7 @@ class at_handler
if (isset($reg['domain']['descr']))
{
while (list($key, $val) = each($reg['domain']['descr']))
foreach ($reg['domain']['descr'] as $key => $val)
{
$v = trim(substr(strstr($val, ':'), 1));
if (strstr($val, '[organization]:'))
@ -99,4 +99,3 @@ class at_handler
return $r;
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -48,7 +48,7 @@ class fastdomain_handler
'domain.status' => 'Status:'
);
while (list($key, $val) = each($data_str))
foreach ($data_str as $key => $val)
{
$faststr = strpos($val, ' (FAST-');
if ($faststr)
@ -65,7 +65,7 @@ class fastdomain_handler
{
reset($r['domain']['nserver']);
$endnserver = false;
while (list($key, $val) = each($r['domain']['nserver']))
foreach ($r['domain']['nserver'] as $key => $val)
{
if ($val == '=-=-=-=')
unset($r['domain']['nserver'][$key]);
@ -75,4 +75,3 @@ class fastdomain_handler
return $r;
}
}
?>

View File

@ -65,7 +65,7 @@ array_splice($data_str['rawdata'],18,1);
if (isset($reg['domain']['descr:']))
{
while (list($key, $val) = each($reg['domain']['descr:']))
foreach ($reg['domain']['descr:'] as $key => $val)
{
$v = trim(substr(strstr($val, ':'), 1));
if (strstr($val, '[organization]:'))
@ -103,4 +103,3 @@ array_splice($data_str['rawdata'],18,1);
return $r;
}
}
?>

View File

@ -60,7 +60,7 @@ class afrinic_handler
}
if (isset($r['owner']['remarks']) && is_array($r['owner']['remarks']))
while (list($key, $val) = each($r['owner']['remarks']))
foreach ($r['owner']['remarks'] as $key => $val)
{
$pos = strpos($val,'rwhois://');
@ -74,4 +74,3 @@ class afrinic_handler
return $r;
}
}
?>

View File

@ -74,7 +74,7 @@ class apnic_handler
$r['registered'] = 'yes';
while (list($key,$val) = each($contacts))
foreach ($contacts as $key => $val)
if (isset($rb[$key]))
{
if (is_array($rb[$key]))
@ -120,4 +120,3 @@ class apnic_handler
return $r;
}
}
?>

View File

@ -43,7 +43,7 @@ class nu_handler
'handle' => 'Record ID:'
);
while (list($key, $val) = each($data_str['rawdata']))
foreach ($data_str['rawdata'] as $key => $val)
{
$val = trim($val);
@ -51,7 +51,7 @@ class nu_handler
{
if ($val == 'Domain servers in listed order:')
{
while (list($key, $val) = each($data_str['rawdata']))
foreach ($data_str['rawdata'] as $key => $val)
{
$val = trim($val);
if ($val == '')
@ -63,7 +63,7 @@ class nu_handler
reset($items);
while (list($field, $match) = each($items))
foreach ($items as $field => $match)
if (strstr($val, $match))
{
$r['regrinfo']['domain'][$field] = trim(substr($val, strlen($match)));
@ -87,4 +87,3 @@ class nu_handler
return $r;
}
}
?>

View File

@ -43,7 +43,7 @@ if (empty($blocks) || !is_array($blocks['main']))
$r = $blocks['main'];
$ret['registered'] = 'yes';
while (list($key,$val) = each($contacts))
foreach ($contacts as $key => $val)
if (isset($r[$key]))
{
if (is_array($r[$key]))
@ -74,7 +74,7 @@ $blocks = false;
$gkey = 'main';
$dend = false;
while (list($key,$val)=each($rawdata))
foreach ($rawdata as $key => $val)
{
$val=trim($val);
@ -341,7 +341,7 @@ if (!$items)
$r = [];
$disok = true;
while (list($key,$val) = each($rawdata))
foreach ($rawdata as $key => $val)
{
if (trim($val) != '')
{
@ -355,7 +355,7 @@ while (list($key,$val) = each($rawdata))
$disok = false;
reset($items);
while (list($match, $field)=each($items))
foreach ($items as $match => $field)
{
$pos = strpos($val,$match);
@ -427,7 +427,7 @@ function get_blocks ( $rawdata, $items, $partial_match = false, $def_block = fal
$r = array();
$endtag = '';
while (list($key,$val) = each($rawdata))
foreach ($rawdata as $key => $val)
{
$val = trim($val);
if ($val == '') continue;
@ -475,7 +475,7 @@ while (list($key,$val) = each($rawdata))
// Block found, get data ...
while (list($key,$val) = each($rawdata))
foreach ($rawdata as $key => $val)
{
$val = trim($val);
@ -624,7 +624,7 @@ if ($extra_items)
$items = $extra_items;
}
while (list($key,$val)=each($array))
foreach ($array as $key => $val)
{
$ok=true;
@ -633,7 +633,7 @@ while (list($key,$val)=each($array))
reset($items);
$ok = false;
while (list($match,$field) = each($items))
foreach ($items as $match => $field)
{
$pos = strpos(strtolower($val),$match);
@ -847,7 +847,7 @@ while (!$ok)
reset($res);
$ok = true;
while (list($key, $val) = each($res))
foreach ($res as $key => $val)
{
if ($val == '' || $key == '') continue;
@ -884,4 +884,3 @@ else
return sprintf("%.4d-%02d-%02d",$res['y'],$res['m'],$res['d']);
}
?>

View File

@ -112,8 +112,8 @@ class utils extends Whois {
if (is_array($nserver))
{
reset($nserver);
while (list($host, $ip) = each($nserver))
reset($nserver);
foreach ($nserver as $host => $ip)
{
$url = '<a href="'. str_replace('$0',$ip,$link)."\">$host</a>";
$out = str_replace($host, $url, $out);
@ -149,4 +149,3 @@ else
return '<a href="'.$url.'" target="_blank">'.$web.'</a>';
}
?>

View File

@ -50,7 +50,7 @@ class zanet_handler
$rawdata = array();
while (list($key, $line) = each($data_str['rawdata']))
foreach ($data_str['rawdata'] as $key => $line)
{
if (strpos($line, ' Contact ') !== false)
{
@ -87,4 +87,3 @@ class zanet_handler
return $r;
}
}
?>