Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem parsing .im domains #110

Open
zaherg opened this issue Apr 7, 2020 · 3 comments
Open

Problem parsing .im domains #110

zaherg opened this issue Apr 7, 2020 · 3 comments

Comments

@zaherg
Copy link
Contributor

zaherg commented Apr 7, 2020

PHP-Whois version: x.y.z

PHP version: 7.3/7.4

Description

  1. If you query the domain twitter.im the expiration date value will be 0 even though the expiration date from the whois record is Expiry Date: 19/02/2021 00:59:50

  2. If you query google.im the expiration date value will be 2020-09-08 even though the expiration date from the whois record is Expiry Date: 09/08/2020 23:59:46

in google domain the date/month has been swapped, and adding the inversedDateMMDD didn't help

How to reproduce

$info = $whois->loadDomainInfo('twitter.im');

if (!$info) {
        throw new WhoisException('Domain is not registered.');
}

return [ 'domainName' => $info->getDomainName(),
        'domainNameUnicode' => $info->getDomainNameUnicode(),
        'owner' => $info->getOwner() ?: 'N/A',
        'registrar' => $info->getRegistrar() ?: 'N/A',
        'creationDate' => date('Y-m-d', $info->getCreationDate() ?: time()),
        'registryExpiryDate' => date('Y-m-d', $info->getExpirationDate() ?: time()),
        'registryExpiryDateUnix' => $info->getExpirationDate(),
        'nameServers' => $info->getNameServers(),
]

Additional context
I have also seen the same behaviour in two domains other than twitter.im

@io-developer
Copy link
Owner

I guess it's due to country date format in same sequence - https://en.wikipedia.org/wiki/Date_format_by_country

Ok, I'll try to fix that

@zaherg
Copy link
Contributor Author

zaherg commented Apr 7, 2020 via email

@zaherg
Copy link
Contributor Author

zaherg commented Apr 9, 2020

I have upgraded to v4.0 but the issue stay the same, the thing that I've noticed is that when you dump the info about a domain you can see that the expiration date is correct

object(Iodev\Whois\Modules\Tld\TldInfo)#980 (5) {
["dataDefault":protected]=>
array(9) {
["parserType"]=>
string(0) ""
["domainName"]=>
string(0) ""
["whoisServer"]=>
string(0) ""
["nameServers"]=>
array(0) {
}
["creationDate"]=>
int(0)
["expirationDate"]=>
int(0)
["states"]=>
array(0) {
}
["owner"]=>
string(0) ""
["registrar"]=>
string(0) ""
}
["response":protected]=>
object(Iodev\Whois\Modules\Tld\TldResponse)#972 (3) {
["dataDefault":protected]=>
array(4) {
["query"]=>
string(0) ""
["text"]=>
string(0) ""
["host"]=>
string(0) ""
["domain"]=>
string(0) ""
}
["data":protected]=>
array(4) {
["domain"]=>
string(10) "twitter.im"
["host"]=>
string(12) "whois.nic.im"
["query"]=>
string(12) "twitter.im
"
["text"]=>
string(617) "
This information has been redacted to comply with European Union General Data Protection Regulations (GDPR). Please
contact us at [email protected] if you have any further queries.

Domain Name: twitter.im
Domain Managers
Name: Redacted
Address
Redacted
Domain Owners / Registrant
Name: Redacted
Address
Redacted
Administrative Contact
Name: Redacted
Address
Redacted
Billing Contact
Name: Redacted
Address
Redacted
Technical Contact
Name: Redacted
Address
Redacted
Domain Details
Expiry Date: 19/02/2021 00:59:50
Name Server:ns1.park.do.
Name Server:ns2.park.do.
"
}
["dataAlias":protected]=>
array(0) {
}
}
["extra":protected]=>
array(5) {
["groups"]=>
array(2) {
[0]=>
array(1) {
[0]=>
string(174) "This information has been redacted to comply with European Union General Data Protection Regulations
(GDPR). Please contact us at [email protected] if you have any further queries."
}
[1]=>
array(20) {
["Domain Name"]=>
string(10) "twitter.im"
[0]=>
string(15) "Domain Managers"
["Name"]=>
array(5) {
[0]=>
string(8) "Redacted"
[1]=>
string(8) "Redacted"
[2]=>
string(8) "Redacted"
[3]=>
string(8) "Redacted"
[4]=>
string(8) "Redacted"
}
[1]=>
string(7) "Address"
[2]=>
string(8) "Redacted"
[3]=>
string(26) "Domain Owners / Registrant"
[4]=>
string(7) "Address"
[5]=>
string(8) "Redacted"
[6]=>
string(22) "Administrative Contact"
[7]=>
string(7) "Address"
[8]=>
string(8) "Redacted"
[9]=>
string(15) "Billing Contact"
[10]=>
string(7) "Address"
[11]=>
string(8) "Redacted"
[12]=>
string(17) "Technical Contact"
[13]=>
string(7) "Address"
[14]=>
string(8) "Redacted"
[15]=>
string(14) "Domain Details"
["Expiry Date"]=>
string(19) "19/02/2021 00:59:50"
["Name Server"]=>
array(2) {
[0]=>
string(12) "ns1.park.do."
[1]=>
string(12) "ns2.park.do."
}
}
}
["rootFilter"]=>
object(Iodev\Whois\Helpers\GroupFilter)#979 (6) {
["groups":"Iodev\Whois\Helpers\GroupFilter":private]=>
array(2) {
[0]=>
array(1) {
[0]=>
string(174) "This information has been redacted to comply with European Union General Data Protection Regulations
(GDPR). Please contact us at [email protected] if you have any further queries."
}
[1]=>
array(20) {
["Domain Name"]=>
string(10) "twitter.im"
[0]=>
string(15) "Domain Managers"
["Name"]=>
array(5) {
[0]=>
string(8) "Redacted"
[1]=>
string(8) "Redacted"
[2]=>
string(8) "Redacted"
[3]=>
string(8) "Redacted"
[4]=>
string(8) "Redacted"
}
[1]=>
string(7) "Address"
[2]=>
string(8) "Redacted"
[3]=>
string(26) "Domain Owners / Registrant"
[4]=>
string(7) "Address"
[5]=>
string(8) "Redacted"
[6]=>
string(22) "Administrative Contact"
[7]=>
string(7) "Address"
[8]=>
string(8) "Redacted"
[9]=>
string(15) "Billing Contact"
[10]=>
string(7) "Address"
[11]=>
string(8) "Redacted"
[12]=>
string(17) "Technical Contact"
[13]=>
string(7) "Address"
[14]=>
string(8) "Redacted"
[15]=>
string(14) "Domain Details"
["Expiry Date"]=>
string(19) "19/02/2021 00:59:50"
["Name Server"]=>
array(2) {
[0]=>
string(12) "ns1.park.do."
[1]=>
string(12) "ns2.park.do."
}
}
}
["headerKey":"Iodev\Whois\Helpers\GroupFilter":private]=>
string(10) "__HEADER__"
["domainKeys":"Iodev\Whois\Helpers\GroupFilter":private]=>
array(7) {
[0]=>
string(6) "domain"
[1]=>
string(10) "domainname"
[2]=>
string(11) "domain_name"
[3]=>
string(11) "domain name"
[4]=>
string(20) "complete domain name"
[5]=>
string(7) "Dominio"
[6]=>
string(5) "query"
}
["subsetParams":"Iodev\Whois\Helpers\GroupFilter":private]=>
array(1) {
["$domain"]=>
string(10) "twitter.im"
}
["matchFirstOnly":"Iodev\Whois\Helpers\GroupFilter":private]=>
bool(false)
["ignoreCase":"Iodev\Whois\Helpers\GroupFilter":private]=>
bool(true)
}
["domainFilter"]=>
object(Iodev\Whois\Helpers\GroupFilter)#977 (6) {
["groups":"Iodev\Whois\Helpers\GroupFilter":private]=>
array(1) {
[0]=>
array(20) {
["Domain Name"]=>
string(10) "twitter.im"
[0]=>
string(15) "Domain Managers"
["Name"]=>
array(5) {
[0]=>
string(8) "Redacted"
[1]=>
string(8) "Redacted"
[2]=>
string(8) "Redacted"
[3]=>
string(8) "Redacted"
[4]=>
string(8) "Redacted"
}
[1]=>
string(7) "Address"
[2]=>
string(8) "Redacted"
[3]=>
string(26) "Domain Owners / Registrant"
[4]=>
string(7) "Address"
[5]=>
string(8) "Redacted"
[6]=>
string(22) "Administrative Contact"
[7]=>
string(7) "Address"
[8]=>
string(8) "Redacted"
[9]=>
string(15) "Billing Contact"
[10]=>
string(7) "Address"
[11]=>
string(8) "Redacted"
[12]=>
string(17) "Technical Contact"
[13]=>
string(7) "Address"
[14]=>
string(8) "Redacted"
[15]=>
string(14) "Domain Details"
["Expiry Date"]=>
string(19) "19/02/2021 00:59:50"
["Name Server"]=>
array(2) {
[0]=>
string(12) "ns1.park.do."
[1]=>
string(12) "ns2.park.do."
}
}
}
["headerKey":"Iodev\Whois\Helpers\GroupFilter":private]=>
string(10) "__HEADER__"
["domainKeys":"Iodev\Whois\Helpers\GroupFilter":private]=>
array(7) {
[0]=>
string(6) "domain"
[1]=>
string(10) "domainname"
[2]=>
string(11) "domain_name"
[3]=>
string(11) "domain name"
[4]=>
string(20) "complete domain name"
[5]=>
string(7) "Dominio"
[6]=>
string(5) "query"
}
["subsetParams":"Iodev\Whois\Helpers\GroupFilter":private]=>
array(1) {
["$domain"]=>
string(10) "twitter.im"
}
["matchFirstOnly":"Iodev\Whois\Helpers\GroupFilter":private]=>
bool(true)
["ignoreCase":"Iodev\Whois\Helpers\GroupFilter":private]=>
bool(true)
}
["primaryFilter"]=>
object(Iodev\Whois\Helpers\GroupFilter)#976 (6) {
["groups":"Iodev\Whois\Helpers\GroupFilter":private]=>
array(1) {
[0]=>
array(20) {
["Domain Name"]=>
string(10) "twitter.im"
[0]=>
string(15) "Domain Managers"
["Name"]=>
array(5) {
[0]=>
string(8) "Redacted"
[1]=>
string(8) "Redacted"
[2]=>
string(8) "Redacted"
[3]=>
string(8) "Redacted"
[4]=>
string(8) "Redacted"
}
[1]=>
string(7) "Address"
[2]=>
string(8) "Redacted"
[3]=>
string(26) "Domain Owners / Registrant"
[4]=>
string(7) "Address"
[5]=>
string(8) "Redacted"
[6]=>
string(22) "Administrative Contact"
[7]=>
string(7) "Address"
[8]=>
string(8) "Redacted"
[9]=>
string(15) "Billing Contact"
[10]=>
string(7) "Address"
[11]=>
string(8) "Redacted"
[12]=>
string(17) "Technical Contact"
[13]=>
string(7) "Address"
[14]=>
string(8) "Redacted"
[15]=>
string(14) "Domain Details"
["Expiry Date"]=>
string(19) "19/02/2021 00:59:50"
["Name Server"]=>
array(2) {
[0]=>
string(12) "ns1.park.do."
[1]=>
string(12) "ns2.park.do."
}
}
}
["headerKey":"Iodev\Whois\Helpers\GroupFilter":private]=>
string(10) "__HEADER__"
["domainKeys":"Iodev\Whois\Helpers\GroupFilter":private]=>
array(7) {
[0]=>
string(6) "domain"
[1]=>
string(10) "domainname"
[2]=>
string(11) "domain_name"
[3]=>
string(11) "domain name"
[4]=>
string(20) "complete domain name"
[5]=>
string(7) "Dominio"
[6]=>
string(5) "query"
}
["subsetParams":"Iodev\Whois\Helpers\GroupFilter":private]=>
array(1) {
["$domain"]=>
string(10) "twitter.im"
}
["matchFirstOnly":"Iodev\Whois\Helpers\GroupFilter":private]=>
bool(true)
["ignoreCase":"Iodev\Whois\Helpers\GroupFilter":private]=>
bool(true)
}
["reserved"]=>
NULL
}
["data":protected]=>
array(9) {
["parserType"]=>
string(13) "indentAutofix"
["domainName"]=>
string(10) "twitter.im"
["states"]=>
array(0) {
}
["nameServers"]=>
array(2) {
[0]=>
string(11) "ns1.park.do"
[1]=>
string(11) "ns2.park.do"
}
["owner"]=>
string(8) "Redacted"
["registrar"]=>
NULL
["creationDate"]=>
int(0)
["expirationDate"]=>
int(0)
["whoisServer"]=>
string(0) ""
}
["dataAlias":protected]=>
array(0) {
}
}

which is ["Expiry Date"]=>string(19) "19/02/2021 00:59:50" but when you try to get the expiration date $info->expirationDate it returns 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants