From eaaf290073dc50d0427732dbc1dd98d330a4b1ce Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 17 Apr 2015 12:06:49 +0200 Subject: [PATCH] Bug 13364: Use SQL placeholder --- cataloguing/value_builder/cn_browser.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cataloguing/value_builder/cn_browser.pl b/cataloguing/value_builder/cn_browser.pl index 44a65df9a6..9aa2631fa0 100755 --- a/cataloguing/value_builder/cn_browser.pl +++ b/cataloguing/value_builder/cn_browser.pl @@ -82,12 +82,12 @@ sub plugin { FROM items AS i JOIN biblio AS b USING (biblionumber) LEFT OUTER JOIN branches ON (branches.branchcode = homebranch) - WHERE cn_sort < '$cn_sort' + WHERE cn_sort < ? AND itemcallnumber != '' ORDER BY cn_sort DESC, itemnumber LIMIT $real_limit;"; $sth = $dbh->prepare($query); - $sth->execute(); + $sth->execute($cn_sort); while ( my $data = $sth->fetchrow_hashref ) { if ( $data->{itemcallnumber} eq $q ) { $data->{background} = 'red'; @@ -102,7 +102,6 @@ sub plugin { unshift @cn, $data; } $rows_lt = $sth->rows; - $sth->finish; } if ( $search ne $lt ) { -- 2.39.5