WorkingClassKid / phpWhois

phpWhois Improved
GNU General Public License v2.0
3 stars 2 forks source link

DeepWhois not being performed correctly on gtld domains #3

Closed Fuitad closed 6 years ago

Fuitad commented 7 years ago

Seems like the whois is either not parsed correctly or the code was not adapted. See screenshot (code is on top and actual result for google.com query under)

https://i.imgur.com/PvFFinz.png

Fuitad commented 7 years ago

I'm actually wrong. For the google.com query, when the code gets to function deepWhois in WhoisClient.php, the dump of $result['regyinfo'] is only

Array ( [registrar] => MarkMonitor Inc. )

So $result is returned without any further whois being performed. Because of this, the data is highly incomplete (missing expiration, etc...)

Fuitad commented 7 years ago

Ah! seems to be related to whois.gtld.php line 37. I changed

'Whois Server:' => 'regyinfo.whois',

to

'Registrar WHOIS Server:' => 'regyinfo.whois',

And deepwhois started working again. But I'm wondering. Is there a reason why the script doesn't do case insensitive matching?

Fuitad commented 7 years ago

In fact, changing line 340 of whois.parser.php from

$pos = strpos($val, $match);

to

$pos = stripos($val, $match);

Also fixed DeepWhois for GTLD and appears to be a better fix than my earlier comment. I'm still not sure if it won't break anything else tho.

Fuitad commented 6 years ago

@webalternative any opinion on this issue?

WorkingClassKid commented 6 years ago

Hi! sorry, I was very busy in the last few weeks... I will take a look this week-end :-)

Fuitad commented 6 years ago

Cool! Take a look at my branch https://github.com/Fuitad/phpWhois/tree/fixing-deepwhois-gtld

Like I said previously, it seems to be working but I'm not sure I didn't break anything else while fixing this :P

WorkingClassKid commented 6 years ago

Hi! I have applied your fix on my site dev version... And yes, I get much more complete results using your fix.

Actually, it's seems to work with every TLDs I have tested with.

If you submit a Pull request I will merge it...or I will add it to the code this week manually if no Pull request is made

Fuitad commented 6 years ago

PR5

https://github.com/webalternative/phpWhois/pull/5

WorkingClassKid commented 6 years ago

Done. Thank you!