]> Sergey Matveev's repositories - public-inbox.git/commitdiff
mid2path: clean MID of angle brackets '<>'
authorEric Wong <e@80x24.org>
Sun, 30 Aug 2015 01:26:46 +0000 (01:26 +0000)
committerEric Wong <e@80x24.org>
Sun, 30 Aug 2015 01:26:46 +0000 (01:26 +0000)
We screwed up and needed to fix URL generation with '<>'
in them.  Regardless, users may attempt to copy and paste
URLs with '<>' in them, do not punish them for that.

lib/PublicInbox/MID.pm

index 8ca3c5797e314e6440aaf36ebc1c1fc4b7134e7c..1b03fdce72e1333132f0884371754b290ac6ed24 100644 (file)
@@ -39,7 +39,7 @@ sub mid2path {
 
        unless (defined $x38) {
                # compatibility with old links (or short Message-IDs :)
-               $mid = sha1_hex($mid);
+               $mid = sha1_hex(mid_clean($mid));
                ($x2, $x38) = ($mid =~ /\A([a-f0-9]{2})([a-f0-9]{38})\z/);
        }
        "$x2/$x38";