Project

General

Profile

Actions

Feature #94162

open

Update Slughelper to allow both dash and lodash Characters

Added by Markus Timtner over 3 years ago. Updated over 1 year ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
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 Harrer, 2021-12-06 15:09

Related issues 1 (0 open1 closed)

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

Actions
Actions

Also available in: Atom PDF