Skip to content

Commit bb06ff9

Browse files
committed
[#1] Use $this->parseRegistryInfo to try to retrieve the Registry Info
1 parent 1c8e5e9 commit bb06ff9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+337
-555
lines changed

src/Handlers/AbstractHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ public static function generic_parser_b( array $rawdata, array $items=[], string
460460
$r['registered'] = 'yes';
461461
}
462462

463-
$r = format_dates($r, $dateformat);
463+
$r = static::formatDates($r, $dateformat);
464464
}
465465

466466
return $r;
@@ -625,7 +625,7 @@ public static function getContacts($array, $extra_items = [], $has_org = false)
625625
* @param array $extra_items
626626
* @param bool $has_org
627627
*/
628-
public static function getContact($array, $extra_items = [], bool $has_org=false): array
628+
public static function getContact($array, $extra_items=[], bool $has_org=false): array
629629
{
630630
if (!is_array($array)) {
631631
return array();
@@ -792,7 +792,7 @@ protected function parseRegistryInfo(array $rawData): array
792792
'Registrar WHOIS Server:' => 'whois',
793793
];
794794

795-
$registryInfo = $this->generic_parser_b($rawData, $registryItems);
795+
$registryInfo = static::generic_parser_b($rawData, $registryItems);
796796
unset($registryInfo['registered']);
797797

798798
return $registryInfo;

src/Handlers/BeHandler.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ public function parse(array $data_str, string $query): array
3131
];
3232

3333
$rawData = $this->removeBlankLines($data_str['rawdata']);
34-
$r = [
35-
'regrinfo' => $this->get_blocks($rawData, $items),
36-
'regyinfo' => [
37-
'referrer' => 'http://www.domain-registry.nl',
34+
35+
$r = [
36+
'regrinfo' => static::getBlocks($rawData, $items),
37+
'regyinfo' => $this->parseRegistryInfo($rawData) ?? [
38+
'referrer' => 'https://www.domain-registry.nl',
3839
'registrar' => 'DNS Belgium',
3940
],
4041
'rawdata' => $data_str['rawdata'],

src/Handlers/BhHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public function parse(array $data_str, string $query): array
2424
} else {
2525
$r['regrinfo']['registered'] = 'yes';
2626
}
27-
$r['regyinfo'] = [
27+
28+
$r['regyinfo'] = $this->parseRegistryInfo($data_str['rawdata']) ?? [
2829
'referrer' => 'http://www.nic.bh/',
2930
'registrar' => 'NIC-BH',
3031
];

src/Handlers/BizHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public function parse(array $data_str, string $query): array
1616
{
1717
$r = [
1818
'regrinfo' => static::generic_parser_b($data_str['rawdata'], [], 'mdy'),
19-
'regyinfo' => [
20-
'referrer' => 'http://www.neulevel.biz',
19+
'regyinfo' => $this->parseRegistryInfo($data_str['rawdata']) ?? [
20+
'referrer' => 'https://www.neulevel.biz',
2121
'registrar' => 'NEULEVEL',
2222
],
2323
'rawdata' => $data_str['rawdata'],

src/Handlers/BrHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public function parse(array $data_str, string $query): array
6363

6464
$a = [
6565
'regrinfo' => $r,
66-
'regyinfo' => [
66+
'regyinfo' => $this->parseRegistryInfo($data_str['rawdata']) ?? [
6767
'registrar' => 'BR-NIC',
68-
'referrer' => 'http://www.nic.br',
68+
'referrer' => 'https://www.nic.br',
6969
],
7070
'rawdata' => $data_str['rawdata'],
7171
];

src/Handlers/CoopHandler.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ public function parse(array $data_str, string $query): array
4949
$blocks = AbstractHandler::getBlocks($data_str['rawdata'], $items);
5050

5151
$r = [
52+
'regrinfo' => [],
53+
'regyinfo' => $this->parseRegistryInfo($data_str['rawdata']) ?? [
54+
'referrer' => 'https://www.nic.coop',
55+
'registrar' => '.coop registry',
56+
],
5257
'rawdata' => $data_str['rawdata'],
5358
];
5459

@@ -77,11 +82,6 @@ public function parse(array $data_str, string $query): array
7782
$r['regrinfo']['registered'] = 'no';
7883
}
7984

80-
$r['regyinfo'] = $this->parseRegistryInfo($data_str['rawdata']) ?? [
81-
'referrer' => 'https://www.nic.coop',
82-
'registrar' => '.coop registry',
83-
];
84-
8585
return $r;
8686
}
8787
}

src/Handlers/CzHandler.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,15 @@ public function parse(array $data_str, string $query): array
3636
'registrant' => 'owner',
3737
];
3838

39-
$r = [
39+
$r = [
40+
'regrinfo' => static::generic_parser_a($data_str['rawdata'], $translate, $contacts),
41+
'regyinfo' => $this->parseRegistryInfo($data_str['rawdata']) ?? [
42+
'referrer' => 'https://www.nic.cz',
43+
'registrar' => 'CZ-NIC',
44+
],
4045
'rawdata' => $data_str['rawdata'],
4146
];
4247

43-
$r['regrinfo'] = static::generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain', 'dmy');
44-
45-
$r['regyinfo'] = [
46-
'referrer' => 'http://www.nic.cz',
47-
'registrar' => 'CZ-NIC',
48-
];
49-
5048
if ($data_str['rawdata'][0] === 'Your connection limit exceeded. Please slow down and try again later.') {
5149
$r['regrinfo']['registered'] = 'unknown';
5250
}

src/Handlers/DeHandler.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ public function parse(array $data_str, string $query): array
3737
];
3838

3939
$rawData = $this->removeBlankLines($data_str['rawdata']);
40-
$r = [
40+
41+
$r = [
4142
'rawdata' => $data_str['rawdata'],
4243
'regrinfo' => static::easyParser($rawData, $items, 'ymd', $extra),
43-
'regyinfo' => [
44+
'regyinfo' => $this->parseRegistryInfo($rawData) ?? [
4445
'registrar' => 'DENIC eG',
4546
'referrer' => 'https://www.denic.de/',
4647
],

src/Handlers/DevHandler.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ class DevHandler extends AbstractHandler
1515
{
1616
public function parse(array $data_str, string $query): array
1717
{
18-
$r = [
19-
'regrinfo' => generic_parser_b($data_str['rawdata']),
18+
return [
19+
'regrinfo' => static::generic_parser_b($data_str['rawdata']),
20+
'regyinfo' => $this->parseRegistryInfo($data_str['rawdata']),
2021
'rawdata' => $data_str['rawdata'],
2122
];
22-
23-
return $r;
2423
}
2524
}

src/Handlers/DkHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function parse(array $data_str, string $query): array
6262

6363
return [
6464
'regrinfo' => $reg,
65-
'regyinfo' => [
65+
'regyinfo' => $this->parseRegistryInfo($data_str['rawdata']) ?? [
6666
'referrer' => 'https://www.dk-hostmaster.dk/',
6767
'registrar' => 'DK Hostmaster'
6868
],

0 commit comments

Comments
 (0)