fixes and improvments in .pl handler

This commit is contained in:
sparc 2007-04-20 16:28:15 +00:00
parent d8d3e0370a
commit 1430af735d
2 changed files with 30 additions and 8 deletions

View file

@ -1,4 +1,7 @@
200/04/18 2007/04/20
- fixes and improvments in .pl handler
2007/04/18
- fixed warnings in nicline and tmagnic gtld handlers - fixed warnings in nicline and tmagnic gtld handlers
- added support for IDNA (internationalized) domains names - added support for IDNA (internationalized) domains names
as defined in RFC3490, RFC3491, RFC3492 and RFC3454 as defined in RFC3490, RFC3491, RFC3492 and RFC3454

View file

@ -32,13 +32,11 @@ require_once('whois.parser.php');
class pl_handler class pl_handler
{ {
function parse($data_str, $query) function parse($data_str, $query)
{ {
$items = array( $items = array(
'owner' => 'Subscribers Contact object:', 'owner' => 'SUBSCRIBERS CONTACT OBJECT:',
'domain' => 'Domain object:', 'domain' => 'DOMAIN OBJECT:',
'tech' => 'Technical Contact:', 'tech' => 'Technical Contact:',
'x' => 'nservers:' 'x' => 'nservers:'
); );
@ -101,15 +99,36 @@ class pl_handler
} }
} }
$r['domain']['nserver'] = $ns;
$r['registered'] = 'yes';
$r = array ( 'regrinfo' => $r ); $r = array ( 'regrinfo' => $r );
if (isset($r['regrinfo']['owner']['address']['city']))
$r['regrinfo']['owner']['address'] = $this->extract_zipcode($r['regrinfo']['owner']['address']);
if (isset($r['regrinfo']['tech']['address']['city']))
$r['regrinfo']['tech']['address'] = $this->extract_zipcode($r['regrinfo']['owner']['address']);
$r['domain']['nserver'] = $ns;
$r['registered'] = 'yes';
} }
else else
$r['regrinfo']['registered'] = 'no'; $r['regrinfo']['registered'] = 'no';
$r['regyinfo'] = array(
'referrer' => 'http://www.dns.pl/english/index.html',
'registrar' => 'NASK'
);
return ($r); return ($r);
} }
function extract_zipcode ($addr)
{
if(preg_match('/(\d{2}-\d{3}) (\w+)/',$addr['city'],$match))
{
$addr['city']=$match[2];
$addr['pcode']=$match[1];
}
return $addr;
}
} }
?> ?>