X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FMID.pm;h=5aeffb8c675bb2882a1f50b92505206e386191e9;hb=c6ca576baf1700a8341ae7b6baa19257ac7deaa7;hp=e9a3b0c094e52b3fce1d330374d03b6bd7520235;hpb=fb4bfa102bfa702f13948ac689e54bac9d0084e0;p=public-inbox.git diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm index e9a3b0c0..5aeffb8c 100644 --- a/lib/PublicInbox/MID.pm +++ b/lib/PublicInbox/MID.pm @@ -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;