summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-06-25 18:54:41 +0200
committerYorhel <git@yorhel.nl>2019-06-25 18:54:43 +0200
commit1ce29f7c3f015bebfff5dd549c43eff77ededd4b (patch)
tree84b5fee8f4427a46022a41070febe01b9fc06dbe
parentce38ff885f82addfec198dc3611d970b97efeafd (diff)
Fix dbManPref(name => "0")HEADmaster
Fixes a timeout and eventual 500 error on https://manned.org/0
-rwxr-xr-xwww/index.pl14
1 files changed, 7 insertions, 7 deletions
diff --git a/www/index.pl b/www/index.pl
index bae9149..0df8980 100755
--- a/www/index.pl
+++ b/www/index.pl
@@ -986,13 +986,13 @@ sub dbSearch {
sub dbManPref {
my($s, %o) = @_;
my %where = (
- $o{name} ? ('m.name = ?' => $o{name}) : (),
- $o{shorthash} ? (q{substring(m.hash from 1 for 4) = decode(?, 'hex')} => $o{shorthash}) : (),
- $o{section} ? ('m.section LIKE ?' => escape_like($o{section}).'%') : (),
- $o{sysid} ? ('p.system = ?' => $o{sysid}) : (),
- $o{package} ? ('p.id = ?' => $o{package}) : (),
- $o{pkgver} ? ('v.id = ?' => $o{pkgver}) : (),
- $o{language}? (q{substring(locale from '^[^.]+') = ?} => $o{language}) : (),
+ length $o{name} ? ('m.name = ?' => $o{name}) : (),
+ $o{shorthash} ? (q{substring(m.hash from 1 for 4) = decode(?, 'hex')} => $o{shorthash}) : (),
+ length $o{section} ? ('m.section LIKE ?' => escape_like($o{section}).'%') : (),
+ $o{sysid} ? ('p.system = ?' => $o{sysid}) : (),
+ $o{package} ? ('p.id = ?' => $o{package}) : (),
+ $o{pkgver} ? ('v.id = ?' => $o{pkgver}) : (),
+ $o{language} ? (q{substring(locale from '^[^.]+') = ?} => $o{language}) : (),
);
# Criteria to determine a "preferred" man page: