1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-22 02:55:41 +02:00

[ticket/9643] Only split $port from $sqlserver, if it's not an IPv6 address.

PHPBB3-9643
This commit is contained in:
Andreas Fischer
2010-06-08 19:27:55 +02:00
parent a5b238019b
commit 879bc89524

View File

@ -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);
}