]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchView.pm
www: do not unecessarily escape some chars in paths
[public-inbox.git] / lib / PublicInbox / SearchView.pm
index 15bb8232ec430ecd99883a3827bba40f78d0e6f3..3623a78b4406e1d90bad1d4b46c536c60c85b0f5 100644 (file)
@@ -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;
@@ -38,11 +38,11 @@ sub sres_top_html {
        my $cb;
        if ($err) {
                $code = 400;
-               $ctx->{-html_tip} = '<pre>'.err_txt($ctx, $err).'</pre><hr />';
+               $ctx->{-html_tip} = '<pre>'.err_txt($ctx, $err).'</pre><hr>';
                $cb = *noop;
        } elsif ($total == 0) {
                $code = 404;
-               $ctx->{-html_tip} = "<pre>\n[No results found]</pre><hr />";
+               $ctx->{-html_tip} = "<pre>\n[No results found]</pre><hr>";
                $cb = *noop;
        } else {
                my $x = $q->{x};
@@ -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";
@@ -126,7 +126,7 @@ sub search_nav_bot {
        my $o = $q->{o};
        my $end = $o + $nr;
        my $beg = $o + 1;
-       my $rv = "</pre><hr /><pre>Results $beg-$end of $total";
+       my $rv = "</pre><hr><pre>Results $beg-$end of $total";
        my $n = $o + $LIM;
 
        if ($n < $total) {
@@ -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";