summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-09-07 14:05:42 +0200
committerYorhel <git@yorhel.nl>2015-09-07 14:05:42 +0200
commit1303a0d1e8b93f6d619dc8e451675f0cb84413a1 (patch)
tree0d3b40fc46ab41c3f0141cf11da6e65dd8b52f69 /lib
parentf51c7276fc65c2d1d46d3c8f915fb1e1412693e8 (diff)
Handler::Discussions: Fix two bugs introduced in last commit
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/DB/Discussions.pm2
-rw-r--r--lib/VNDB/Handler/Discussions.pm2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/VNDB/DB/Discussions.pm b/lib/VNDB/DB/Discussions.pm
index a85205f2..2be975db 100644
--- a/lib/VNDB/DB/Discussions.pm
+++ b/lib/VNDB/DB/Discussions.pm
@@ -218,7 +218,7 @@ sub dbPostGet {
);
# Get headlines in a separate query
- if($o{search} && $#$r) {
+ if($o{search} && @$r) {
my %r = map {
($r->[$_]{tid}.'.'.$r->[$_]{num}, $_)
} 0..$#$r;
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm
index 0362dce3..0b1e5254 100644
--- a/lib/VNDB/Handler/Discussions.pm
+++ b/lib/VNDB/Handler/Discussions.pm
@@ -415,7 +415,7 @@ sub search {
# TODO: Allow or-matching too. But what syntax?
(my $ts = $frm->{bq}) =~ y{+|&:*()="';!?$%^\\[]{}<>~` }{ }s;
$ts =~ s/ / & /g;
- $ts =~ s/(^| )-([^ ]+)/ !$1 /;
+ $ts =~ s/(?:^| )-([^ ]+)/ !$1 /;
($l, $np) = $self->dbPostGet(
keys %boards ? ( type => [keys %boards] ) : (),
search => $ts,