about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchView.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-08-14 10:21:09 +0000
committerEric Wong <e@80x24.org>2016-08-14 10:51:02 +0000
commit9d1e5fadd7d18f4c96ab0509d673040e34225a04 (patch)
treedd89df05390a2ca2e06448ec0acdbf741729d36e /lib/PublicInbox/SearchView.pm
parent1d0ce406b75fc174bee51e77efe5f10c61fb6098 (diff)
downloadpublic-inbox-9d1e5fadd7d18f4c96ab0509d673040e34225a04.tar.gz
Based on reading RFC 3986, it seems '@', ':', '!', '$', '&',
"'", '; '(', ')', '*', '+', ',', ';', '=' are all allowed
in path-absolute where we have the Message-ID.

In any case, it seems '@' is fairly common in path components
nowadays and too common in Message-IDs.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r--lib/PublicInbox/SearchView.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 80a2ff7c..3623a78b 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -8,7 +8,7 @@ use warnings;
 use PublicInbox::SearchMsg;
 use PublicInbox::Hval qw/ascii_html/;
 use PublicInbox::View;
-use PublicInbox::MID qw(mid2path mid_mime mid_clean);
+use PublicInbox::MID qw(mid2path mid_mime mid_clean mid_escape);
 use Email::MIME;
 require PublicInbox::Git;
 require PublicInbox::Thread;
@@ -74,7 +74,7 @@ sub mset_summary {
                 my $s = ascii_html($smsg->subject);
                 my $f = ascii_html($smsg->from_name);
                 my $ts = PublicInbox::View::fmt_ts($smsg->ts);
-                my $mid = PublicInbox::Hval->new_msgid($smsg->mid)->as_href;
+                my $mid = PublicInbox::Hval->new_msgid($smsg->mid)->{href};
                 $$res .= qq{$rank. <b><a\nhref="$mid/">}.
                         $s . "</a></b>\n";
                 $$res .= "$pfx  - by $f @ $ts UTC [$pct%]\n\n";
@@ -239,6 +239,7 @@ package PublicInbox::SearchQuery;
 use strict;
 use warnings;
 use PublicInbox::Hval;
+use PublicInbox::MID qw(mid_escape);
 
 sub new {
         my ($class, $qp) = @_;
@@ -263,7 +264,7 @@ sub qs_html {
                 $self = $tmp;
         }
 
-        my $q = PublicInbox::Hval->new($self->{'q'})->as_href;
+        my $q = mid_escape($self->{'q'});
         $q =~ s/%20/+/g; # improve URL readability
         my $qs = "q=$q";