Feature #94162

Update Slughelper to allow both dash and lodash Characters

Added by Markus Timtner about 1 year ago. Updated 6 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
Start date:
2021-05-19
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
routing fallbackCharacter
Complexity:
easy
Sprint Focus:

Description

Hi there,

at the moment, the slughelper converts both dash and lodash to the fallback character -

typo3/sysext/core/Classes/DataHandling/SlugHelper.php:115

// Convert some special tokens (space, "_" and "-") to the space character
$fallbackCharacter = (string)($this->configuration['fallbackCharacter'] ?? '-');
$slug = preg_replace('/[ \t\x{00A0}\-+_]+/u', $fallbackCharacter, $slug);
Page title with - and _ x
is converted to:
page-title-with-and-x

Since both Characters are valid for urls, it would be good if there would be at least the option to keep these characters,
so that the result would be

page-title-with-and-_-x


Files

core-10.4.21.patch (2.52 KB) core-10.4.21.patch Eric Bode, 2021-12-06 15:09

Related issues

Related to TYPO3 Core - Bug #94693: Slug fieldSeparator (and replacements) replaced by fallbackCharacterClosed2021-08-02

Actions

Also available in: Atom PDF