lib/PublicInbox/MID.pm | 4 ++-- diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm index 7f1ab15ea731db8f0f70304662afe338754b5c6c..6904d61a0303bb0edd2b17b479c85e6bd13e76ff 100644 --- a/lib/PublicInbox/MID.pm +++ b/lib/PublicInbox/MID.pm @@ -26,11 +26,11 @@ } $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); }