Project

General

Profile

Actions

Bug #84180

closed

Default database charset in ConnectionPool is not valid

Added by Philipp Rönsch over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2018-03-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
dbal, connection pool, database, charset, encoding
Complexity:
Is Regression:
Sprint Focus:

Description

When configuring an additional or new database like this:

$connectionParams = [
    'dbname' => '..',
    'user' => '..',
    'password' => '..',
    'host' => '..',
    'driver' => '..'
];
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['..'] =  $connectionParams;

the option 'charset' can be left out without issue of connection.

ConnectionPool will default to a new charset setting, but not a valid one at this line:
https://api.typo3.org/typo3cms/8/html/_connection_pool_8php_source.html#l00146
The charset 'utf-8' is invalid and content loaded from a UTF-8 database like this, will have unknown characters in them, causing issues when the conent is parsed via htmlspecialchars() for example.

As solution, the charset configuration should be required or default to the proper string 'utf8'.

Actions #1

Updated by Gerrit Code Review over 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56081

Actions #2

Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56086

Actions #3

Updated by Wolfgang Klinger over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF