some improvments on generic3.whois

This commit is contained in:
sparc 2003-03-26 20:52:32 +00:00
parent f93d4932cf
commit 3eb71cda24
3 changed files with 62 additions and 32 deletions

View file

@ -30,54 +30,82 @@ function get_blocks ( $rawdata, $items )
$endtag="";
while (list($field, $match)=each($items))
{
// search block header
reset($rawdata);
while (list($key,$val)=each($rawdata))
{
$val=trim($val);
if ($val=="") continue;
$found=false;
reset($items);
while (list($key,$val)=each($rawdata))
{
$pos=strpos($val,$match);
if ($pos!==false)
{
$last=substr(trim($val),-1,1);
while (list($field, $match)=each($items)) {
if ($last==":" || $last=="-" || $last=="]")
{
$found=true;
$endtag=$last;
break;
}
else {
$var=getvarname(strtok($field,"#"));
$itm=trim(substr($val,$pos+strlen($match)));
eval($var."=\$itm;");
}
}
}
$pos=strpos($val,$match);
if ($field!="" && $pos!==false) {
$last=substr(trim($val),-1,1);
if ($last==":" || $last=="-" || $last=="]") {
$found=true;
$endtag=$last;
$line=$val;
break;
}
else {
$var=getvarname(strtok($field,"#"));
$itm=trim(substr($val,$pos+strlen($match)));
eval($var."=\$itm;");
}
}
}
if (!$found) continue;
$block=array();
$found=false;
$spaces=0;
while (list($key,$val)=each($rawdata))
{
$val=trim($val);
if ($val=="")
{ if ($found) break;
else continue;
}
$found=true;
if ($val=="") {
if ($found && ++$spaces==2) break;
continue;
}
if (!$found) {
$found=true;
$block[]=$val;
continue;
}
$last=substr(trim($val),-1,1);
//if ($last==":" || $last=="-") break;
if ($last==$endtag) break;
if ($last==$endtag) {
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;
}
$var=getvarname($field);
eval($var."=\$block;");
reset($items);
while (list($field, $match)=each($items)) {
$pos=strpos($line,$match);
if ($pos!==false) {
$var=getvarname($field);
eval($var."=\$block;");
}
}
}
return $r;

View file

@ -44,6 +44,7 @@ class opensrsnet extends gtld {
$items = array( "owner" => "Registrant:",
"admin" => "Administrative Contact",
"tech" => "Technical Contact",
"domain.name" => "Domain name:",
"domain.sponsor" => "Registration Service Provider:",
"domain.nserver" => "Domain servers in listed order:",
"domain.changed" => "Record last updated on",

View file

@ -45,6 +45,7 @@ class registercom extends gtld {
"admin" => "Administrative Contact",
"tech" => "Technical Contact",
"zone" => "Zone Contact",
"" => "Registrar Name....:",
"domain.nserver" => "Domain servers in listed order:",
"domain.name" => "Domain name:",
"domain.created" => "Created on..............:",