]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MID.pm
mid: drop repeated ';' in mid_escape() regular expression
[public-inbox.git] / lib / PublicInbox / MID.pm
index e9a3b0c094e52b3fce1d330374d03b6bd7520235..5aeffb8c675bb2882a1f50b92505206e386191e9 100644 (file)
@@ -12,7 +12,7 @@ use URI::Escape qw(uri_escape_utf8);
 use Digest::SHA qw/sha1_hex/;
 require PublicInbox::Address;
 use constant {
-       MID_MAX => 40, # SHA-1 hex length # TODO: get rid of this
+       ID_MAX => 40, # SHA-1 hex length for HTML id anchors
        MAX_MID_SIZE => 244, # max term size (Xapian limitation) - length('Q')
 };
 
@@ -32,7 +32,7 @@ sub mid_clean {
 sub id_compress {
        my ($id, $force) = @_;
 
-       if ($force || $id =~ /[^a-zA-Z0-9_\-]/ || length($id) > MID_MAX) {
+       if ($force || $id =~ /[^a-zA-Z0-9_\-]/ || length($id) > ID_MAX) {
                utf8::encode($id);
                return sha1_hex($id);
        }
@@ -125,7 +125,7 @@ sub uniq_mids ($;$) {
 }
 
 # RFC3986, section 3.3:
-sub MID_ESC () { '^A-Za-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@' }
+sub MID_ESC () { '^A-Za-z0-9\-\._~!\$\&\'\(\)\*\+,;=:@' }
 sub mid_escape ($) { uri_escape_utf8($_[0], MID_ESC) }
 
 1;