Skip to content

Commit

Permalink
Bug #14547 Fix using different protocols for the same driver type.
Browse files Browse the repository at this point in the history
When merging the base config for the SQL driver we must remove the
inappropriate settings since they will both be present when the
config arrays are merged.
  • Loading branch information
mrubinsk committed Jan 14, 2017
1 parent 7c5f1ac commit c247069
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion framework/Core/lib/Horde.php
Expand Up @@ -319,9 +319,24 @@ public static function getDriverConfig($backend, $type = 'sql')

if (!is_null($c) && isset($c['params'])) {
$c['params']['umask'] = $conf['umask'];
return (!is_null($type) && isset($conf[$type]))

$result = (!is_null($type) && isset($conf[$type]))
? array_merge($conf[$type], $c['params'])
: $c['params'];

// HOTFIX for Bug #14547. If using different protocols for the
// base SQL config and the explicit driver we are creating, we
// need to remove the not-used connection config since they use
// different keys.
if (!is_null($type) && $type == 'sql') {
if ($c['params']['protocol'] == 'unix') {
unset($result['hostspec'], $result['port']);
} else {
unset($result['socket']);
}
}

return $result;
}

return (!is_null($type) && isset($conf[$type]))
Expand Down

0 comments on commit c247069

Please sign in to comment.