From 94f13e1f179c4b7c43d75f1154eec178718988c8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 17 Aug 2015 08:05:03 +0000 Subject: view: always compress Message-IDs for anchors Valid URLs do not make valid anchor ids. --- lib/PublicInbox/MID.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/MID.pm') diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm index c75aa0e1..2f0c09fb 100644 --- a/lib/PublicInbox/MID.pm +++ b/lib/PublicInbox/MID.pm @@ -19,7 +19,7 @@ sub mid_clean { # this is idempotent sub mid_compressed { - my ($mid) = @_; + my ($mid, $force) = @_; # XXX dirty hack! FIXME! # Some HTTP servers (apache2 2.2.22-13+deb7u5 on my system) @@ -28,7 +28,7 @@ sub mid_compressed { # or what; will need to debug... return sha1_hex($mid) if (index($mid, '%') >= 0); - return $mid if (length($mid) <= MID_MAX); + return $mid if (!$force && length($mid) <= MID_MAX); sha1_hex($mid); } -- cgit v1.2.3-24-ge0c7