diff options
author | Tom Feist <shabble@metavore.org> | 2011-07-20 08:38:54 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2011-07-20 08:38:54 +0000 |
commit | 205dfaa87262a343c608a02fcc75b09914c51464 (patch) | |
tree | 61cac5d6bc1d4d3abdba52f4e6d30e074c6c0282 /longify | |
parent | changed format reset to format delete for chansetup_footer, to properly resto... (diff) | |
download | irssi-scripts-205dfaa87262a343c608a02fcc75b09914c51464.tar.gz irssi-scripts-205dfaa87262a343c608a02fcc75b09914c51464.zip |
add additional check to avoid crash if URI doesn't have a 'host' method.
Diffstat (limited to '')
-rw-r--r-- | longify/longify-urls.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/longify/longify-urls.pl b/longify/longify-urls.pl index 38e8ba8..cd36503 100644 --- a/longify/longify-urls.pl +++ b/longify/longify-urls.pl @@ -130,7 +130,12 @@ sub _handle_messages { my $uri_obj = URI->new($url); - return unless ref($uri_obj) && exists $domains->{$uri_obj->host}; + # check we've got a valid url + return unless ref($uri_obj); + return unless $uri_obj->can('host'); + + # match against the whitelist. + return unless exists $domains->{$uri_obj->host}; $pending_msg_params->{$url} = [@_]; $lookup_in_progress = 1; |