From 21061d61da23d6df64f69afd7acc2da4b92ee09d Mon Sep 17 00:00:00 2001 From: Juan Pablo Ramirez Date: Thu, 14 Sep 2023 15:26:17 +0200 Subject: [PATCH] #633 Quote schema for PostgreSQL in the CakeAdapter --- src/CakeAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CakeAdapter.php b/src/CakeAdapter.php index 7e5eeafc..c5bcad7c 100644 --- a/src/CakeAdapter.php +++ b/src/CakeAdapter.php @@ -58,7 +58,7 @@ public function __construct(AdapterInterface $adapter, ?Connection $connection = if ($connection->getDriver() instanceof Postgres) { $config = $connection->config(); $schema = empty($config['schema']) ? 'public' : $config['schema']; - $pdo->exec('SET search_path TO ' . $schema); + $pdo->exec('SET search_path TO ' . $pdo->quote($schema)); } $connection->getDriver()->setConnection($pdo); }