Bug 15760 RMaint Avoid SQL injections

For security purpose, backport a fix to the way the DB connection is
established.
This commit is contained in:
Frédéric Demians 2016-02-12 12:23:22 +01:00
parent 9ac267821e
commit 23716ebcc3
1 changed files with 7 additions and 1 deletions

View File

@ -52,7 +52,13 @@ sub _new_schema {
# we are letting C4::Context->dbh not set the RaiseError handle attribute
# for now for compatbility purposes
my $schema = Koha::Schema->connect( sub { C4::Context->dbh }, { unsafe => 1 } );
my $schema = Koha::Schema->connect(
sub { C4::Context->dbh },
{
unsafe => 1,
quote_names => 1,
}
);
return $schema;
}