when submitting an IP or example.com.au domain name. everything before .xxx.xxx gets truncated.

submitting example.com.au results in error:

Whois lookup for com.au:
No Data Found

yet /whois/example.com.au works fine

using phpwhois-4.1.3

Any ideas, can anyone confirm this as a bug?

CommentFileSizeAuthor
#5 whois-303833.patch1.05 KBhelmo

Comments

Gurpartap Singh’s picture

Priority: Normal » Critical

Whoops, I can confirm that this will happen with the url strip-down regexp I'm using in the module. This is actually critical.

sersim’s picture

I've commented out the regexp in the file whois.module, and it works now.

function whois_parse_url($url) {
//$r = "^(?:(?P\w+)://)?";
//$r .= "(?:(?P\w+):(?P
\w+)@)?";
//$r .= "(?P(?:(?P[\w\.]+)\.)?" . "(?P\w+\.(?P\w+)))";
//$r .= "(?::(?P
\d+))?";
//$r .= "(?P
[\w/]*/(?P\w+(?:\.\w+)?)?)?";
//$r .= "(?:\?(?P[\w=&]+))?";
//$r .= "(?:#(?P\w+))?";
//$r = "!$r!"; // Delimiters

//preg_match($r, $url, $result);
//return $result[6];
return $url;
}

Gurpartap Singh’s picture

Title: Strange Behavior » Fix the url regular expression
Gurpartap Singh’s picture

Marked http://drupal.org/node/333050 as a duplicate.

helmo’s picture

Status: Active » Needs work
StatusFileSize
new1.05 KB

The attached patch expands the regexp to include some multi-level tld's. However this currently requires a list of all these cases, which is hard to maintain.

helmo’s picture

Status: Needs work » Fixed

Fix for #653156: Unfixable whois_parse_url, which should resolve this issue, has been committed.

Please re-open if the problem persists.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.