]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: use URI::Escape to escape URIs
authorEric Wong <normalperson@yhbt.net>
Sat, 5 Apr 2014 10:54:24 +0000 (10:54 +0000)
committerEric Wong <normalperson@yhbt.net>
Sat, 5 Apr 2014 10:54:24 +0000 (10:54 +0000)
CGI::escape is not a documented subroutine, so the chances of
it going away are higher.

lib/PublicInbox/View.pm

index 3d3b6b5e948bcbb0c388fbbd6b8f27053c504798..3f3fea5a36e35f4f18c0b5a7e213abe751ef5a31 100644 (file)
@@ -3,7 +3,8 @@
 package PublicInbox::View;
 use strict;
 use warnings;
-use CGI qw/escapeHTML escape/;
+use URI::Escape qw/uri_escape/;
+use CGI qw/escapeHTML/;
 use Encode qw/decode encode/;
 use Encode::MIME::Header;
 
@@ -111,7 +112,7 @@ sub trim_message_id {
        my ($mid) = @_;
        $mid =~ tr/<>//d;
        my $html = escapeHTML($mid);
-       my $href = escapeHTML(escape($mid));
+       my $href = escapeHTML(uri_escape($mid));
 
        ($html, $href);
 }