Project

General

Profile

Actions

Bug #93764

closed

SlugHelper can create bad urls

Added by Dmitry Dulepov over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
Start date:
2021-03-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

This happens if the user types title in a certain way in some browsers. Usually there are different ways to types letters with umlauts: either by using a dedicated key on the keyboard, or by typing a "dead key" followed by a normal key, or by typing a key and a sequence that adds umlauts to the previously typed key. The last case creates problems with slugs.

It is possible to reproduce this artificially for those who do not have keyboard layouts that produce characters with umlauts. Assuming that page uid is 12345, use this sql:

update pages set title=x'667275cc88686e65757a6569746c6963' where uid=12345;

This sets the title field to "frühneuzeitlichen" where the "ü" character is represented as 0x75+0xCC88. Here 0x75 is "u", 0xCC88 is a "combining diaeresis" (https://www.fileformat.info/info/unicode/char/0308/index.htm).

Now if you open the page and press double sided arrows near the slug field, it will make wrong "/frühneuzeitlichen" instead of correct "/fruehneuzeitlichen" and in frontend it will look even worse, like "/fruiˆhneuzeitlichen".

This happens because TYPO3 cannot process such characters.

Note that some browsers will make an interesting side effect out of this: Safari, for example, will normalize the title to the "C" form automatically when you submit the form. Internally TYPO3 compares submitted values with values in the database and updates modified fields. So even though you did not modify the title, it will be updated in the database due to Safari's automatic Unicode normalization. I got information that other browsers do not behave like this. Thus some users will be stuck with wrong slugs and URLs.

This bug can be easily fixed with the help of "Normalize" class, which is a standard PHP class.

This should be fixe din the SlugHelper, before calling convertSpecCharsToAscii. Note that convertSpecCharsToAscii would not be a right place for it because by definition it does not do any normalizations.

The issue was discovered and the fix is created by the University of Basel.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #93883: Transliteration of german umlauts fails partly on file upload for files created on macClosed2021-04-08

Actions
Actions #1

Updated by Gerrit Code Review over 3 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/c/Packages/TYPO3.CMS/+/68492

Actions #2

Updated by Gerrit Code Review over 3 years ago

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

Actions #3

Updated by Gerrit Code Review over 3 years ago

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

Actions #4

Updated by Gerrit Code Review over 3 years ago

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

Actions #5

Updated by Gerrit Code Review over 3 years ago

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

Actions #6

Updated by Dmitry Dulepov over 3 years ago

Failing tests and strange warnings from phpstan. Sorry for these many patches...

Actions #7

Updated by Gerrit Code Review over 3 years ago

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

Actions #8

Updated by Gerrit Code Review over 3 years ago

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

Actions #9

Updated by Gerrit Code Review over 3 years ago

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

Actions #10

Updated by Benni Mack over 3 years ago

  • Target version changed from 11.2 to 11.3
Actions #11

Updated by Gerrit Code Review over 3 years ago

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

Actions #12

Updated by Gerrit Code Review over 3 years ago

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

Actions #13

Updated by Dmitry Dulepov over 3 years ago

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

Updated by Martin Kutschker over 3 years ago

  • Related to Bug #93883: Transliteration of german umlauts fails partly on file upload for files created on mac added
Actions #15

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF