Bug 7105: Bad request in GetSubscriptions

If $string or $issn is passed to GetSubscriptions, the request is false.
See Bug 5864, especially the last comment from Frédérick Capovilla.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Christophe Croullebois 2011-10-27 15:50:19 +02:00 committed by Paul Poulain
parent 92913a2f3f
commit 32317878c0
1 changed files with 2 additions and 2 deletions

View File

@ -588,7 +588,7 @@ sub GetSubscriptions {
$tmpstring =~ s/^AND //;
push @sqlstrings, $tmpstring;
}
$sqlwhere .= ( $sqlwhere ? " AND " : " WHERE " ) . "(" . join( ") OR (", @sqlstrings ) . ")";
$sqlwhere .= ( $sqlwhere ? " AND " : " WHERE " ) . "((" . join( ") OR (", @sqlstrings ) . "))";
}
if ($issn) {
my @sqlstrings;
@ -601,7 +601,7 @@ sub GetSubscriptions {
$tmpstring =~ s/^OR //;
push @sqlstrings, $tmpstring;
}
$sqlwhere .= ( $sqlwhere ? " AND " : " WHERE " ) . "(" . join( ") OR (", @sqlstrings ) . ")";
$sqlwhere .= ( $sqlwhere ? " AND " : " WHERE " ) . "((" . join( ") OR (", @sqlstrings ) . "))";
}
$sql .= "$sqlwhere ORDER BY title";
$debug and warn "GetSubscriptions query: $sql params : ", join( " ", @bind_params );