phpWhois icon indicating copy to clipboard operation
phpWhois copied to clipboard

Whois output is not correctly parsed if it contains empty lines

Open stollr opened this issue 6 years ago • 4 comments

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 avatar Feb 19 '19 13:02 stollr

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

stollr avatar Feb 19 '19 13:02 stollr

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?

jsmitty12 avatar Feb 19 '19 13:02 jsmitty12

google.de for example ;)

stollr avatar Feb 19 '19 14:02 stollr

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.

jsmitty12 avatar Jun 01 '20 02:06 jsmitty12