Bug 23390: (follow-up) Quote aliases

Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2019-07-31 11:43:11 +00:00 committed by Martin Renvoize
parent 187b3c5539
commit c13de8ca65
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -1085,6 +1085,7 @@ sub get_prepped_report {
my ($type,$name) = split /\|/,$split[$i*2+1]; # We split them on '|'
$headers->{$name} = $type; # Store as a lookup for the template
$split[$i*2+1] =~ s/(\||\?|\.|\*|\(|\)|\%)/\\$1/g; #Quote any special characters so we can replace the placeholders
$name = C4::Context->dbh->quote($name);
$sql =~ s/\[\[$split[$i*2+1]\]\]/$type AS $name/; # Remove placeholders from SQL
}