]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www_stream: fix search for new.html endpoint
authorEric Wong <e@80x24.org>
Fri, 1 Jul 2016 00:20:19 +0000 (00:20 +0000)
committerEric Wong <e@80x24.org>
Fri, 1 Jul 2016 00:30:28 +0000 (00:30 +0000)
We want to avoid the bare './' wherever possible, but it
doesn't seem possible here.

lib/PublicInbox/WwwStream.pm

index 6de1b310da360bbbee5bcbd580b7d552bc2b8298..d9abb5ab8068756d51c3f5aaae5b9098703744ce 100644 (file)
@@ -39,7 +39,8 @@ sub _html_top ($) {
                }
                # XXX gross, for SearchView.pm
                my $extra = $ctx->{-extra_form_html} || '';
                }
                # XXX gross, for SearchView.pm
                my $extra = $ctx->{-extra_form_html} || '';
-               $top = qq{<form\naction="$upfx"><pre>$top} .
+               my $action = $upfx eq '' ? './' : $upfx;
+               $top = qq{<form\naction="$action"><pre>$top} .
                          qq{ <input\nname=q\ntype=text$q_val/>} .
                          $extra .
                          qq{<input\ntype=submit\nvalue=search />} .
                          qq{ <input\nname=q\ntype=text$q_val/>} .
                          $extra .
                          qq{<input\ntype=submit\nvalue=search />} .