Re: URI::Heuristic module not expanding partial url(s) containing a d ash
Gisle Aas (gisle@activestate.com)
09 Jan 2001 12:46:43 -0800
"Khamphasouk, Chantha" <khamphas@cobaltgroup.com> writes:
> During use of the URI::Heuristic module, we encountered the module not
> expanding partial url(s) containing a dash.
> Example:
> Before expanding After
> epxanding
> some-site some-site
> some-site.com some-site.com
>
> Do you have any suggestions (as a work-around or solution) for this issue?
Try this patch:
Index: URI/Heuristic.pm
===================================================================
RCS file: /cvsroot/libwww-perl/uri/URI/Heuristic.pm,v
retrieving revision 4.11
diff -u -p -d -u -r4.11 Heuristic.pm
--- URI/Heuristic.pm 1999/03/20 07:34:27 4.11
+++ URI/Heuristic.pm 2001/01/09 20:44:07
@@ -145,7 +145,7 @@ sub uf_uristr ($)
$_ = "mailto:$_";
} elsif (!/^[.+\-\w]+:/) { # no scheme specified
- if (s/^(\w+(?:\.\w+)*)([\/:\?\#]|$)/$2/) {
+ if (s/^([-\w]+(?:\.[-\w]+)*)([\/:\?\#]|$)/$2/) {
my $host = $1;
if ($host !~ /\./ && $host ne "localhost") {
Regards,
Gisle