From 418bb491628d7ecb480fc0815de31f462483a21e Mon Sep 17 00:00:00 2001 From: Arend-Jan Tetteroo Date: Tue, 11 Jun 2013 10:39:01 +0200 Subject: [PATCH 1/2] Remove the network cleanup as I need the inetnum information --- Result/Result.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Result/Result.php b/Result/Result.php index ccb46e3..ff0f274 100644 --- a/Result/Result.php +++ b/Result/Result.php @@ -497,10 +497,6 @@ public function cleanUp($config, $dateformat) unset($this->lastHandle); } - if (isset($this->network->contacts) && sizeof($this->network->contacts) === 1) { - $this->network = null; - } - // format dates $this->template = $config['template']; $this->changed = $this->formatDate($dateformat, $this->changed); From c3d594f271f9580b821b49bed56c42bd7b62eb8d Mon Sep 17 00:00:00 2001 From: Arend-Jan Tetteroo Date: Wed, 2 Oct 2013 13:40:51 +0200 Subject: [PATCH 2/2] Add Inetnum information to IANA for 0.0.0.0/8 The whois output for 0.0.0.0 and up returns other information than the IANA template understands. This commit adds the inetnum information and adds the organisation as the network:name --- Templates/Iana.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Templates/Iana.php b/Templates/Iana.php index 5bcba98..8679c87 100644 --- a/Templates/Iana.php +++ b/Templates/Iana.php @@ -41,7 +41,7 @@ class Template_Iana extends AbstractTemplate * @var array * @access protected */ - protected $blocks = array(1 => '/whois:(?>[\x20\t]*)(.*?)[\n]{2}/is', + protected $blocks = array(1 => '/(inetnum|whois):(?>[\x20\t]*)(.*?)[\n]{2}/is', 2 => '/domain:(?>[\x20\t]*)(.*?)[\n]{2}/is', 3 => '/organisation:(?>[\x20\t]*)(.*?)(?=contact:(?>[\x20\t]*)administrative)/is', 4 => '/contact:(?>[\x20\t]*)administrative(.*?)(?=contact:(?>[\x20\t]*)technical)/is', @@ -54,7 +54,11 @@ class Template_Iana extends AbstractTemplate * @var array * @access protected */ - protected $blockItems = array(1 => array('/^whois:(?>[\x20\t]*)(.+)$/im' => 'whoisserver'), + protected $blockItems = array(1 => array( + '/^whois:(?>[\x20\t]*)(.+)$/im' => 'whoisserver', + '/^inetnum:(?>[\x20\t]*)(.+)$/im' => 'network:inetnum', + '/organisation:(?>[\x20\t]*)(.+)$/im' => 'network:name' + ), 2 => array('/^domain:(?>[\x20\t]*)(.+)$/im' => 'name'), 3 => array('/organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:organization', '/address:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:address'),