aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-06-08 19:27:55 +0200
committerAndreas Fischer <bantu@phpbb.com>2010-06-08 19:27:55 +0200
commit879bc89524aa98874d6de45dc057cb7ff45bd7ed (patch)
tree393425cdf87229c8f102ca416956b4d57e7d8666
parenta5b238019b24a944e4ca8c6fe34dee9897790bd6 (diff)
downloadforums-879bc89524aa98874d6de45dc057cb7ff45bd7ed.tar
forums-879bc89524aa98874d6de45dc057cb7ff45bd7ed.tar.gz
forums-879bc89524aa98874d6de45dc057cb7ff45bd7ed.tar.bz2
forums-879bc89524aa98874d6de45dc057cb7ff45bd7ed.tar.xz
forums-879bc89524aa98874d6de45dc057cb7ff45bd7ed.zip
[ticket/9643] Only split $port from $sqlserver, if it's not an IPv6 address.
PHPBB3-9643
-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);
}