Commit e138d5d5 authored by Benjamin Eberlei's avatar Benjamin Eberlei

[DBAL-137] Skip empty hosts in MySQL and PostgreSQL driver dsn construction.

parent 6a650987
...@@ -56,7 +56,7 @@ class Driver implements \Doctrine\DBAL\Driver ...@@ -56,7 +56,7 @@ class Driver implements \Doctrine\DBAL\Driver
private function _constructPdoDsn(array $params) private function _constructPdoDsn(array $params)
{ {
$dsn = 'mysql:'; $dsn = 'mysql:';
if (isset($params['host'])) { if (isset($params['host']) && $params['host'] != '') {
$dsn .= 'host=' . $params['host'] . ';'; $dsn .= 'host=' . $params['host'] . ';';
} }
if (isset($params['port'])) { if (isset($params['port'])) {
......
...@@ -34,7 +34,7 @@ class Driver implements \Doctrine\DBAL\Driver ...@@ -34,7 +34,7 @@ class Driver implements \Doctrine\DBAL\Driver
private function _constructPdoDsn(array $params) private function _constructPdoDsn(array $params)
{ {
$dsn = 'pgsql:'; $dsn = 'pgsql:';
if (isset($params['host'])) { if (isset($params['host']) && $params['host'] != '') {
$dsn .= 'host=' . $params['host'] . ' '; $dsn .= 'host=' . $params['host'] . ' ';
} }
if (isset($params['port'])) { if (isset($params['port'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment