www: Fix search redirect if no section is specified
i.e. let the man_pref logic determine the most useful section, instead of forcing the first relevant section in the redirect.
This commit is contained in:
parent
9a81147983
commit
962a7c848a
1 changed files with 1 additions and 1 deletions
|
|
@ -602,7 +602,7 @@ TUWF::get '/browse/search' => sub {
|
|||
# Redirect if we have an exact match
|
||||
my @sectsql = length $sect ? ('AND section =', \$sect) : ();
|
||||
my $man = length $name && tuwf->dbRowi('SELECT name, section FROM mans WHERE name =', \$name, @sectsql);
|
||||
return tuwf->resRedirect("/man/$man->{name}.$man->{section}", 'temp') if length $man->{name};
|
||||
return tuwf->resRedirect("/man/$man->{name}".(length $sect ? ".$man->{section}" : ''), 'temp') if length $man->{name};
|
||||
|
||||
# Otherwise, do case-insensitive glob search
|
||||
my $nameq = escape_like(lc $name) =~ tr/?*/_%/r;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue