Issue Bug Closed

#108884youtube video title with emojis crashes the backend (not sanitized?)

Riccardo De Contardi 02/06/26, 09:42 updated 02/10/26, 08:22

Description

Environment:

latest TYPO3 main built with ddev on MACOS 15.7.3

steps to reproduce

1. Go to Media (Filelist) module, click on a folder
2. Click on “New file“
3. On “Add new media asset” input, paste the following URL

https://www.youtube.com/watch?v=sU-mOeSYfTg

Result:

The modal crashes with the error:

(1/3) #1366 Doctrine\DBAL\Exception\DriverException
An exception occurred while executing a query: Incorrect string value: '\xF0\x9F\x98\xB8\xF0\x9F...' for column `db`.`sys_file`.`name` at row 1

Same error occurs every time I try to access the folder where I tried to save the video

What I have found so far

1. The sys_file table has CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
2. Despite the error message AFAICS nothing has been yet written on the database
3. The culprit are the emoji in the video title: “I gatti più divertenti di sempre 😸😂 Prova la sfida “Non ridere””

because if I go to the filesystem and rename

Best_Funny_Cats_Ever_😸😂_Not_To_Laugh_ChallengeTry.youtube

into

Best_Funny_Cats_Ever_Not_To_Laugh_ChallengeTry.youtube

everything works again

Note

Benjamin Franzke suggested me to add

$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['charset'] = 'utf8mb4';

I tried to add it to my AdditionalConfiguration.php but without improvement

—-

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 9

  1. Georg Ringer commented <span data-processor="relativetime" data-value="2026-02-06T10:26:52+00:00" > 02/06/26, 10:26 </span>

    easier to reproduce: just add

    Die lustigsten Katzen aller Zeiten 😸😂 Lach-Challenge (Versuch's mal!)

    to the title of a sys_file

  2. Georg Ringer commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2026-02-06T10:32:40+00:00" > 02/06/26, 10:32 </span>

    so it should be

    'DB' => [
            'Connections' => [
                'Default' => [
                    'charset' => 'utf8mb4',
                    'driver' => 'mysqli',
                    'tableOptions' => [
                        'charset' => 'utf8mb4',
                        'collate' => 'utf8mb4_unicode_ci',
                    ]
                ],
            ],
        ],

    but also the tables and fields must be utf8mb4!

  3. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2026-02-06T10:42:14+00:00" > 02/06/26, 10:42 </span>

    Georg Ringer wrote in #note-2:
    > so it should be
    > […]
    >
    > but also the tables and fields must be utf8mb4!

    No, either I am doing something wrong or that does not help, either.

    As far as I can see the field name on the table sys_file has encoding=utf8mb4 , collation=utf8mb4_unicode_ci

  4. Garvin Hicking commented <span data-processor="relativetime" data-value="2026-02-06T22:12:56+00:00" > 02/06/26, 22:12 </span>

    Riccardo, can you inspect your typo3_conf_vars in the backend config module and verify that ylu really have utf8mb4 showing up there?

    You could also debug the connection with a custom dbal sql call, but that would be a bit of work

  5. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2026-02-07T09:56:02+00:00" > 02/07/26, 09:56 </span>

    Garvin Hicking wrote in #note-4:
    > Riccardo, can you inspect your typo3_conf_vars in the backend config module and verify that ylu really have utf8mb4 showing up there?
    >
    > You could also debug the connection with a custom dbal sql call, but that would be a bit of work

    In fact $GLOBALS[‘TYPO3_CONF_VARS’] reports DB.Connections.Default.charset = utf8 :/ where is it taken from, then?

  6. Garvin Hicking commented <span data-processor="relativetime" data-value="2026-02-08T20:42:07+00:00" > 02/08/26, 20:42 </span>

    Must be within your chain of settings.php and additional.php. Maybe grep for “utf8” (lowercase) in all your files?

  7. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2026-02-09T14:52:12+00:00" > 02/09/26, 14:52 </span>

    OK, I had to change the file /typo3conf/system/settings.php

    from:

        'DB' => [
            'Connections' => [
                'Default' => [
                    'driver' => 'mysqli',
                    'charset' => 'utf8',              
                ],
            ],
        ],

    to:

        'DB' => [
            'Connections' => [
                'Default' => [
                    'driver' => 'mysqli',
                    'charset' => 'utf8mb4',
                    'tableOptions' => [
                        'charset' => 'utf8mb4',
                        'collate' => 'utf8mb4_unicode_ci',
                    ],                
                ],
            ],
        ],

    I don’t know if it’s the correct way to do it on a DDEV installation, though.

    Moreover, shouldn’t this be a standard in a DDEV installation?

  8. Garvin Hicking commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-02-09T19:44:23+00:00" > 02/09/26, 19:44 </span>

    I’m closing the issue due to being config related, hope thats fine.

    If you have a typo3conf/… file then you are using classic/monorepo mode in ddev. You’re on your own there as ddev only supports composer mode, and there the files are located in another place (/config).

  9. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2026-02-10T08:22:25+00:00" > 02/10/26, 08:22 </span>

    Thanks for the assistance; that’s probable that my old installation has some quirks