Bug 23390: (follow-up) Quote aliases
authorNick Clemens <nick@bywatersolutions.com>
Wed, 31 Jul 2019 11:43:11 +0000 (11:43 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 13 Aug 2019 10:46:35 +0000 (11:46 +0100)
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>

reports/guided_reports.pl

index ab13e1f..bb4e87e 100755 (executable)
@@ -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
     }