From 2cfe464f96be4083c498396d3b57cee6ca1b00a8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Jun 2012 16:09:04 +0200 Subject: [PATCH 1/1] Bug 7955: Followup: Fix badly use of dbh->quote --- C4/Members/Statistics.pm | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/C4/Members/Statistics.pm b/C4/Members/Statistics.pm index 302259c..4a2e347 100644 --- a/C4/Members/Statistics.pm +++ b/C4/Members/Statistics.pm @@ -50,7 +50,11 @@ sub construct_query { my $fields = C4::Context->preference('StatisticsFields') || 'location|itype|ccode'; my @select_fields = split '\|', $fields; my $query = "SELECT COUNT(*) as count_$count"; - $query .= ", " . C4::Context->dbh->quote( $_ ) for @select_fields; + for my $field ( @select_fields ) { + $field = C4::Context->dbh->quote( $field ); + $field =~ s/^'(.*)'$/$1/; + $query .= ", $field"; + } $query .= " " . $subquery; -- 1.7.7.3