Actions
Bug #65529
closedhandler_init - wrong management of port if null
Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2015-03-04
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
On \TYPO3\CMS\Dbal\Database\DatabaseConnection, method handler_init
If $handlerKey === '_DEFAULT', the current port (this->handlerCfg[$handlerKey]['config']['port') is set to (int)$this->databasePort.
If $this->databasePort is 0, 0.1, it's ok. However, if it's null, it returns 0;
By this way, when using for mssqlnative,
$cfgArray['config']['host'] . (isset($cfgArray['config']['port']) ? ':' . $cfgArray['config']['port'] : '') (Line 3102)
always renders, for example :
8.8.8.8:0
It causing an error.
To avoid this, I suggest :
if(isset($this->databasePort)) { $this->handlerCfg[$handlerKey]['config']['port'] = (int)$this->databasePort; }
instead of
$this->handlerCfg[$handlerKey]['config']['port'] = (int)$this->databasePort; (line 3020)
By this way, if it's null, it won't render ":0".
Actions