Fix dbManPref(name => "0")

Fixes a timeout and eventual 500 error on https://manned.org/0
This commit is contained in:
Yorhel 2019-06-25 18:54:41 +02:00
parent ce38ff885f
commit 1ce29f7c3f

View file

@ -986,13 +986,13 @@ sub dbSearch {
sub dbManPref { sub dbManPref {
my($s, %o) = @_; my($s, %o) = @_;
my %where = ( my %where = (
$o{name} ? ('m.name = ?' => $o{name}) : (), length $o{name} ? ('m.name = ?' => $o{name}) : (),
$o{shorthash} ? (q{substring(m.hash from 1 for 4) = decode(?, 'hex')} => $o{shorthash}) : (), $o{shorthash} ? (q{substring(m.hash from 1 for 4) = decode(?, 'hex')} => $o{shorthash}) : (),
$o{section} ? ('m.section LIKE ?' => escape_like($o{section}).'%') : (), length $o{section} ? ('m.section LIKE ?' => escape_like($o{section}).'%') : (),
$o{sysid} ? ('p.system = ?' => $o{sysid}) : (), $o{sysid} ? ('p.system = ?' => $o{sysid}) : (),
$o{package} ? ('p.id = ?' => $o{package}) : (), $o{package} ? ('p.id = ?' => $o{package}) : (),
$o{pkgver} ? ('v.id = ?' => $o{pkgver}) : (), $o{pkgver} ? ('v.id = ?' => $o{pkgver}) : (),
$o{language}? (q{substring(locale from '^[^.]+') = ?} => $o{language}) : (), $o{language} ? (q{substring(locale from '^[^.]+') = ?} => $o{language}) : (),
); );
# Criteria to determine a "preferred" man page: # Criteria to determine a "preferred" man page: