diff options
author | Eric Wong <e@80x24.org> | 2016-05-30 01:57:52 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-05-30 01:57:52 +0000 |
commit | fbcb7de93884b7915ea17906d112e1e8cb0dd490 (patch) | |
tree | 7d5b50d96f133827affb4808364358e121677828 /lib/PublicInbox/SearchView.pm | |
parent | 1addae0198108a14cec9d3b306f5c51c70a5e053 (diff) | |
download | public-inbox-fbcb7de93884b7915ea17906d112e1e8cb0dd490.tar.gz |
Still a work in progress, but SearchView no longer depends on Plack::Request at all and Feed is getting there. We now parse all query parameters up front, but we may do that lazily again in the future.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r-- | lib/PublicInbox/SearchView.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 0ae05052..2ec7ddf8 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -16,7 +16,7 @@ our $LIM = 50; sub sres_top_html { my ($ctx) = @_; - my $q = PublicInbox::SearchQuery->new($ctx->{cgi}); + my $q = PublicInbox::SearchQuery->new($ctx->{qp}); my $code = 200; # double the limit for expanded views: @@ -260,13 +260,13 @@ use warnings; use PublicInbox::Hval; sub new { - my ($class, $cgi) = @_; - my $r = $cgi->param('r'); - my ($off) = (($cgi->param('o') || '0') =~ /(\d+)/); + my ($class, $qp) = @_; + + my $r = $qp->{r}; bless { - q => $cgi->param('q'), - x => $cgi->param('x') || '', - o => $off, + q => $qp->{'q'}, + x => $qp->{x} || '', + o => (($qp->{o} || '0') =~ /(\d+)/), r => (defined $r && $r ne '0'), }, $class; } |