aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/postgres.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/db/postgres.php')
-rw-r--r--phpBB/includes/db/postgres.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index b3139b3d79..2a885f1d04 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -46,7 +46,10 @@ class dbal_postgres extends dbal
if ($sqlserver)
{
- if (strpos($sqlserver, ':') !== false)
+ // $sqlserver can carry a port separated by : for compatibility reasons
+ // If $sqlserver has more than one : it's probably an IPv6 address.
+ // In this case we only allow passing a port via the $port variable.
+ if (substr_count($sqlserver, ':') === 1)
{
list($sqlserver, $port) = explode(':', $sqlserver);
}