Add a (hidden) feature for filtering authors down to a set, not just one.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Mar 2016 17:32:05 +0000 (18:32 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Mar 2016 17:32:05 +0000 (18:32 +0100)
perl/Sesse/pr0n/Index.pm

index 7d2ddf8..cb83a92 100644 (file)
@@ -122,9 +122,8 @@ sub handler {
                }
        }
        if (defined($author)) {
-               my $aq = $dbh->quote($author);
-
-               $where .= " AND takenby=$aq";
+               my @authors = split /,/, $author;
+               $where .= " AND takenby IN (" . join(', ', map { $dbh->quote($_) } @authors) . ")";
        }
 
        if (defined($num) && $num == -1) {