about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-17 08:05:03 +0000
committerEric Wong <e@80x24.org>2015-08-17 08:05:03 +0000
commit94f13e1f179c4b7c43d75f1154eec178718988c8 (patch)
tree9c87792ffd47e7866a2a8021d2e6a4dd30bd07d0 /lib
parent2bb820dae8164402d9b1596ba3d801c9fd89f92f (diff)
downloadpublic-inbox-94f13e1f179c4b7c43d75f1154eec178718988c8.tar.gz
Valid URLs do not make valid anchor ids.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/MID.pm4
-rw-r--r--lib/PublicInbox/View.pm2
2 files changed, 3 insertions, 3 deletions
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);
 }
 
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 55e12f26..e7ca73dc 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -477,7 +477,7 @@ sub linkify_refs {
 
 sub anchor_for {
         my ($msgid) = @_;
-        'm' . mid_compressed(mid_clean($msgid));
+        'm' . mid_compressed(mid_clean($msgid), 1);
 }
 
 sub simple_dump {