Open alglyzin opened 4 years ago
Add whois.parser.php (function parseStandardDate())
// EXAMPLE: domain-registrar AT isoc.org.il 20201019 (Assigned)
$pattern = '/\s(\d{4})(\d{2})(\d{2})\s?|$/';
if (preg_match_all($pattern, $date, $matches, PREG_SET_ORDER, 0) !== false) {
$dateTimeFormat = 'Y-m-d';
$date = "{$matches[0][1]}-{$matches[0][2]}-{$matches[0][3]}";
$utc = new DateTimeZone('UTC');
return Datetime::createFromFormat($dateTimeFormat, $date, $utc);
}
Got this message for the value
Updated Date: 0001-01-01T00:00:00.00Z
That "if value < 70" needs at least a is_numeric to prevent this error; better would be a null value returned for this kind of dates.
https://github.com/jsmitty12/phpWhois/blob/3918cb2982b70bfb4a21939d2e37cc4fc6ded28e/src/whois.parser.php#L905
Using whois: artphone.co.il Problem parse date for line: "domain-registrar AT isoc.org.il 20201019 (Assigned)"