From eb2050a720e3c85f8ae81bde2ac3086e1610c2f9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 17 Sep 2008 15:11:57 +0000 Subject: [PATCH] Use correct port delimiter for MSSQL connections in windows. (Bug #16615) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8866 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/db/mssql.php | 4 +++- phpBB/includes/db/mssql_odbc.php | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index d97c36d540..0d45c5f5ca 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -112,6 +112,7 @@
  • [Fix] Display popular topic based on posts within topic instead of replies within topic. (Bug #16099)
  • [Fix] Expand shown ban reason in unban screen to fully show long entries. (Bug #16234)
  • [Fix] Preserve alpha transparency for created thumbnails. (Bug #16575)
  • +
  • [Fix] Use correct port delimiter for MSSQL connections in windows. (Bug #16615)
  • [Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.
  • [Change] Display warning in ACP if config.php file is left writable.
  • diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index 97be2bfb3f..4131be2c32 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -32,9 +32,11 @@ class dbal_mssql extends dbal { $this->persistency = $persistency; $this->user = $sqluser; - $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; + $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':'; + $this->server = $sqlserver . (($port) ? $port_delimiter . $port : ''); + @ini_set('mssql.charset', 'UTF-8'); @ini_set('mssql.textlimit', 2147483647); @ini_set('mssql.textsize', 2147483647); diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 3b5f41affd..a29af45c8f 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -40,9 +40,11 @@ class dbal_mssql_odbc extends dbal { $this->persistency = $persistency; $this->user = $sqluser; - $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; + $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':'; + $this->server = $sqlserver . (($port) ? $port_delimiter . $port : ''); + $max_size = @ini_get('odbc.defaultlrl'); if (!empty($max_size)) {