Skip to content
Snippets Groups Projects
Unverified Commit 36db7a60 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst Committed by GitHub
Browse files

Bugfix: persistent overrides options (#1555)

Fix that persistent would override other database options.

Closes: #1546
parent d453bc48
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,7 @@ class Database ...@@ -86,7 +86,7 @@ class Database
{ {
$driverOptions = $config->getArray('database.driver_options', []); $driverOptions = $config->getArray('database.driver_options', []);
if ($config->getBoolean('database.persistent', true)) { if ($config->getBoolean('database.persistent', true)) {
$driverOptions = [PDO::ATTR_PERSISTENT => true]; $driverOptions[PDO::ATTR_PERSISTENT] = true;
} }
// connect to the primary // connect to the primary
...@@ -136,7 +136,7 @@ class Database ...@@ -136,7 +136,7 @@ class Database
'database.username' => $config->getString('database.username', null), 'database.username' => $config->getString('database.username', null),
'database.password' => $config->getString('database.password', null), 'database.password' => $config->getString('database.password', null),
'database.prefix' => $config->getString('database.prefix', ''), 'database.prefix' => $config->getString('database.prefix', ''),
'database.persistent' => $config->getBoolean('database.persistent', false), 'database.persistent' => $config->getBoolean('database.persistent', true),
], ],
// TODO: deprecated: the "database.slave" terminology is preserved here for backwards compatibility. // TODO: deprecated: the "database.slave" terminology is preserved here for backwards compatibility.
'secondaries' => $config->getArray('database.secondaries', $config->getArray('database.slaves', [])), 'secondaries' => $config->getArray('database.secondaries', $config->getArray('database.slaves', [])),
......
...@@ -681,10 +681,15 @@ class SAMLBuilder ...@@ -681,10 +681,15 @@ class SAMLBuilder
* @param \SAML2\XML\md\RoleDescriptor $rd The RoleDescriptor the certificate should be added to. * @param \SAML2\XML\md\RoleDescriptor $rd The RoleDescriptor the certificate should be added to.
* @param string $use The value of the 'use' attribute. * @param string $use The value of the 'use' attribute.
* @param string $x509data The certificate data. * @param string $x509data The certificate data.
* @param string|null $keyName The name of the key. Should be valid for usage in an ID attribute, e.g. not start with a digit. * @param string|null $keyName The name of the key. Should be valid for usage in an ID attribute,
* e.g. not start with a digit.
*/ */
private function addX509KeyDescriptor(RoleDescriptor $rd, string $use, string $x509data, ?string $keyName = null): void private function addX509KeyDescriptor(
{ RoleDescriptor $rd,
string $use,
string $x509data,
?string $keyName = null
): void {
Assert::oneOf($use, ['encryption', 'signing']); Assert::oneOf($use, ['encryption', 'signing']);
$keyDescriptor = \SAML2\Utils::createKeyDescriptor($x509data, $keyName); $keyDescriptor = \SAML2\Utils::createKeyDescriptor($x509data, $keyName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment