about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-06-04 02:04:23 +0000
committerEric Wong <e@80x24.org>2019-06-04 10:06:18 +0000
commit1f8065599d934b2af7d24773bb7d6901f9586945 (patch)
tree40dabacd72f9c1d5a5a48c4f28e3b6420f701bc2
parent53a7adb8aa292f032c44886f220c3e8ed5f93378 (diff)
downloadpublic-inbox-1f8065599d934b2af7d24773bb7d6901f9586945.tar.gz
Its result is used for HTML anchors and such.
-rw-r--r--lib/PublicInbox/MID.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm
index 7f1ab15e..6904d61a 100644
--- a/lib/PublicInbox/MID.pm
+++ b/lib/PublicInbox/MID.pm
@@ -26,11 +26,11 @@ sub mid_clean {
         $mid;
 }
 
-# this is idempotent
+# this is idempotent, used for HTML anchor/ids and such
 sub id_compress {
         my ($id, $force) = @_;
 
-        if ($force || $id =~ /[^\w\-]/ || length($id) > MID_MAX) {
+        if ($force || $id =~ /[^a-zA-Z0-9_\-]/ || length($id) > MID_MAX) {
                 utf8::encode($id);
                 return sha1_hex($id);
         }