jsmitty12 / phpWhois

phpWhois general repository
GNU General Public License v2.0
56 stars 20 forks source link

Whois output is not correctly parsed if it contains empty lines #40

Open stollr opened 5 years ago

stollr commented 5 years ago

If the raw output of the whois query contains empty lines, the while loop in the get_blocks function of file whois.parser.php stops before all lines are processed.

The reason is obvious:

while ($val = current($rawdata))

$val is falsy when the line is empty.

Imho this is a big issue. Because Whois is telling that a domain is free, although it is wrong.

stollr commented 5 years ago

The problem does not occur for .com domains, but it happens for example for .de domains.

jsmitty12 commented 5 years ago

Interesting. Obviously the original authors never anticipated whois data to contain blank lines.

Do you know of a domain that has whois data with a blank line in it so we can create a test for it?

stollr commented 5 years ago

google.de for example ;)

jsmitty12 commented 4 years ago

This one is pretty tricky... I think I'm going to have to either rewrite the easy_parser() function or write a completely new parser to handle this.