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;
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};
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";
sub err_txt {
my ($ctx, $err) = @_;
my $u = '//xapian.org/docs/queryparser.html';
- $u = PublicInbox::Hval::prurl($ctx->{cgi}->{env}, $u);
+ $u = PublicInbox::Hval::prurl($ctx->{env}, $u);
$err =~ s/^\s*Exception:\s*//; # bad word to show users :P
$err = ascii_html($err);
"\nBad query: <b>$err</b>\n" .
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) {
use strict;
use warnings;
use PublicInbox::Hval;
+use PublicInbox::MID qw(mid_escape);
sub new {
my ($class, $qp) = @_;
$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";