aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Plugin/URL_Title.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Plugin/URL_Title.pm b/Plugin/URL_Title.pm
index 1d0056e..3297bed 100644
--- a/Plugin/URL_Title.pm
+++ b/Plugin/URL_Title.pm
@@ -71,12 +71,13 @@ sub message
return unless $title;
my $shorturl = $url;
- $shorturl = (substr $url, 0, $config{url_len}) . "…" if length ($url) > $config{url_len};
-
# remove http(s):// to avoid triggering other poorly configured bots
$shorturl =~ s,^https?://,,g;
$shorturl =~ s,/$,,g;
+ # truncate URL without http(s):// to configured length if needed
+ $shorturl = (substr $shorturl, 0, $config{url_len}) . "…" if length ($shorturl) > $config{url_len};
+
my $composed_title = "$title ($shorturl)";
return $composed_title;
}