From b4b3c1aa9b2b185b5e9b30d8512a02b15c3e7c4f Mon Sep 17 00:00:00 2001 From: Marlin Cremers Date: Sun, 24 Dec 2017 00:51:59 +0000 Subject: [PATCH] Support IPv6 for database servers Signed-off-by: Marlin Cremers --- lib/private/DB/ConnectionFactory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php index fcb0117a0db38..87b4a8a92664c 100644 --- a/lib/private/DB/ConnectionFactory.php +++ b/lib/private/DB/ConnectionFactory.php @@ -1,6 +1,7 @@ * @author Joas Schilling @@ -8,6 +9,7 @@ * @author Morris Jobke * @author Robin Appelman * @author Thomas Müller + * @author Marlin Cremers * * @license AGPL-3.0 * @@ -193,7 +195,7 @@ public function createConnectionParams() { $connectionParams['path'] = $dataDir . '/' . $name . '.db'; } else { $host = $this->config->getValue('dbhost', ''); - if (strpos($host, ':')) { + if (strpos($host, ':') && !strstr($host, '[')) { // Host variable may carry a port or socket. list($host, $portOrSocket) = explode(':', $host, 2); if (ctype_digit($portOrSocket)) {