diff options
| author | 2016-01-21 17:31:02 -0700 | |
|---|---|---|
| committer | 2016-01-21 17:31:02 -0700 | |
| commit | 4e56c58306d3df163df5cf48fe9836dcac196e4c (patch) | |
| tree | 2dddf8a1328b559ea902c48ccf86c4769a9484fb /lib | |
| parent | 24ee93be35413ac72570f79762ffe9e8f3db7463 (diff) | |
Ensure that with default configuration, the shortener will not be used but also won't print out any extra warnings
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ASM/Shortener.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ASM/Shortener.pm b/lib/ASM/Shortener.pm index f2f6b29..cd3f32a 100644 --- a/lib/ASM/Shortener.pm +++ b/lib/ASM/Shortener.pm @@ -9,6 +9,13 @@ sub shorturl { my $module = shift; my ($url) = @_; + if ((!defined($::settings->{web}->{shortener})) || + (!defined($::settings->{web}->{shortener}->{domain})) || + (!defined($::settings->{web}->{shortener}->{apikey})) || + ($::settings->{web}->{shortener}->{domain} eq '') || + ($::settings->{web}->{shortener}->{apikey} eq '')) { + return $url; + } my $apikey = $::settings->{web}->{shortener}->{apikey}; my $domain = $::settings->{web}->{shortener}->{domain}; my $ua = LWP::UserAgent->new; |
