some improvments on generic3.whois
This commit is contained in:
parent
f93d4932cf
commit
3eb71cda24
3 changed files with 62 additions and 32 deletions
|
@ -30,54 +30,82 @@ function get_blocks ( $rawdata, $items )
|
||||||
|
|
||||||
$endtag="";
|
$endtag="";
|
||||||
|
|
||||||
while (list($field, $match)=each($items))
|
while (list($key,$val)=each($rawdata))
|
||||||
{
|
{
|
||||||
// search block header
|
$val=trim($val);
|
||||||
reset($rawdata);
|
if ($val=="") continue;
|
||||||
|
|
||||||
$found=false;
|
$found=false;
|
||||||
|
reset($items);
|
||||||
|
|
||||||
while (list($key,$val)=each($rawdata))
|
while (list($field, $match)=each($items)) {
|
||||||
{
|
|
||||||
$pos=strpos($val,$match);
|
|
||||||
if ($pos!==false)
|
|
||||||
{
|
|
||||||
$last=substr(trim($val),-1,1);
|
|
||||||
|
|
||||||
if ($last==":" || $last=="-" || $last=="]")
|
$pos=strpos($val,$match);
|
||||||
{
|
|
||||||
$found=true;
|
if ($field!="" && $pos!==false) {
|
||||||
$endtag=$last;
|
$last=substr(trim($val),-1,1);
|
||||||
break;
|
|
||||||
}
|
if ($last==":" || $last=="-" || $last=="]") {
|
||||||
else {
|
$found=true;
|
||||||
$var=getvarname(strtok($field,"#"));
|
$endtag=$last;
|
||||||
$itm=trim(substr($val,$pos+strlen($match)));
|
$line=$val;
|
||||||
eval($var."=\$itm;");
|
break;
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
}
|
$var=getvarname(strtok($field,"#"));
|
||||||
|
$itm=trim(substr($val,$pos+strlen($match)));
|
||||||
|
eval($var."=\$itm;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$found) continue;
|
if (!$found) continue;
|
||||||
|
|
||||||
$block=array();
|
$block=array();
|
||||||
$found=false;
|
$found=false;
|
||||||
|
$spaces=0;
|
||||||
|
|
||||||
while (list($key,$val)=each($rawdata))
|
while (list($key,$val)=each($rawdata))
|
||||||
{
|
{
|
||||||
$val=trim($val);
|
$val=trim($val);
|
||||||
if ($val=="")
|
if ($val=="") {
|
||||||
{ if ($found) break;
|
if ($found && ++$spaces==2) break;
|
||||||
else continue;
|
continue;
|
||||||
}
|
}
|
||||||
$found=true;
|
if (!$found) {
|
||||||
|
$found=true;
|
||||||
|
$block[]=$val;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$last=substr(trim($val),-1,1);
|
$last=substr(trim($val),-1,1);
|
||||||
//if ($last==":" || $last=="-") break;
|
if ($last==$endtag) {
|
||||||
if ($last==$endtag) break;
|
prev($rawdata);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ($spaces>0) {
|
||||||
|
reset($items);
|
||||||
|
$ok=true;
|
||||||
|
while (list($field, $match)=each($items)) {
|
||||||
|
$pos=strpos($val,$match);
|
||||||
|
if ($pos!==false) $ok=false;
|
||||||
|
}
|
||||||
|
if (!$ok) {
|
||||||
|
prev($rawdata);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
$block[]=$val;
|
$block[]=$val;
|
||||||
}
|
}
|
||||||
|
|
||||||
$var=getvarname($field);
|
reset($items);
|
||||||
eval($var."=\$block;");
|
|
||||||
|
while (list($field, $match)=each($items)) {
|
||||||
|
$pos=strpos($line,$match);
|
||||||
|
if ($pos!==false) {
|
||||||
|
$var=getvarname($field);
|
||||||
|
eval($var."=\$block;");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $r;
|
return $r;
|
||||||
|
|
|
@ -44,6 +44,7 @@ class opensrsnet extends gtld {
|
||||||
$items = array( "owner" => "Registrant:",
|
$items = array( "owner" => "Registrant:",
|
||||||
"admin" => "Administrative Contact",
|
"admin" => "Administrative Contact",
|
||||||
"tech" => "Technical Contact",
|
"tech" => "Technical Contact",
|
||||||
|
"domain.name" => "Domain name:",
|
||||||
"domain.sponsor" => "Registration Service Provider:",
|
"domain.sponsor" => "Registration Service Provider:",
|
||||||
"domain.nserver" => "Domain servers in listed order:",
|
"domain.nserver" => "Domain servers in listed order:",
|
||||||
"domain.changed" => "Record last updated on",
|
"domain.changed" => "Record last updated on",
|
||||||
|
|
|
@ -45,6 +45,7 @@ class registercom extends gtld {
|
||||||
"admin" => "Administrative Contact",
|
"admin" => "Administrative Contact",
|
||||||
"tech" => "Technical Contact",
|
"tech" => "Technical Contact",
|
||||||
"zone" => "Zone Contact",
|
"zone" => "Zone Contact",
|
||||||
|
"" => "Registrar Name....:",
|
||||||
"domain.nserver" => "Domain servers in listed order:",
|
"domain.nserver" => "Domain servers in listed order:",
|
||||||
"domain.name" => "Domain name:",
|
"domain.name" => "Domain name:",
|
||||||
"domain.created" => "Created on..............:",
|
"domain.created" => "Created on..............:",
|
||||||
|
|
Loading…
Reference in a new issue