From b61fecef0dac68b6aebd36d5da329e1414d32a7c Mon Sep 17 00:00:00 2001 From: Thijs Kinkhorst <thijs@kinkhorst.com> Date: Thu, 6 Jan 2022 20:19:07 +0100 Subject: [PATCH] Bugfix: persistent overrides options (#1555) Fix that persistent would override other database options. Closes: #1546 (cherry picked from commit 36db7a60f1650e7155cadefcfe01ff6c92e079cc) --- lib/SimpleSAML/Database.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/SimpleSAML/Database.php b/lib/SimpleSAML/Database.php index 719157ca7..9feb2d6f2 100644 --- a/lib/SimpleSAML/Database.php +++ b/lib/SimpleSAML/Database.php @@ -84,7 +84,7 @@ class Database { $driverOptions = $config->getArray('database.driver_options', []); if ($config->getBoolean('database.persistent', true)) { - $driverOptions = [PDO::ATTR_PERSISTENT => true]; + $driverOptions[PDO::ATTR_PERSISTENT] = true; } // connect to the master @@ -128,7 +128,7 @@ class Database 'database.username' => $config->getString('database.username', null), 'database.password' => $config->getString('database.password', null), 'database.prefix' => $config->getString('database.prefix', ''), - 'database.persistent' => $config->getBoolean('database.persistent', false), + 'database.persistent' => $config->getBoolean('database.persistent', true), ], 'slaves' => $config->getArray('database.slaves', []), ]; -- GitLab