aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2011-07-20 08:38:54 +0000
committerTom Feist <shabble@metavore.org>2011-07-20 08:38:54 +0000
commit205dfaa87262a343c608a02fcc75b09914c51464 (patch)
tree61cac5d6bc1d4d3abdba52f4e6d30e074c6c0282
parentchanged format reset to format delete for chansetup_footer, to properly resto... (diff)
downloadirssi-scripts-205dfaa87262a343c608a02fcc75b09914c51464.tar.gz
irssi-scripts-205dfaa87262a343c608a02fcc75b09914c51464.zip
add additional check to avoid crash if URI doesn't have a 'host' method.
-rw-r--r--longify/longify-urls.pl7
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;