[TASK] Move slug normalization into dedicated class
The current `SlugHelper` implementation make several tasks hard to implement, for example language aware transliteration, customization for extension tables or 3rd party data adaptations. It makes sense to extract the `slug (url segment)` sanitization into a dedicated normalization class as a preparation for further improvements and also making the new implementation DI aware right from the start. Other parts will be streamlined in further changes to modernize the slightly unhandy `SlugHelper`. This change moves the slug normalization code now from the `SlugHelper::sanitize()` method into a dedicated class, adjusts the `SlugHelper` tests and duplicate the tests for the new implementation. Resolves: #104090 Releases: main Change-Id: I5126dedc3c9e1e0395087f72d3aafd41c30b4980 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84608 Reviewed-by:Stefan Bürk <stefan@buerk.tech> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/core/Classes/DataHandling/SlugHelper.php 14 additions, 36 deletionstypo3/sysext/core/Classes/DataHandling/SlugHelper.php
- typo3/sysext/core/Classes/Slug/SlugNormalizer.php 75 additions, 0 deletionstypo3/sysext/core/Classes/Slug/SlugNormalizer.php
- typo3/sysext/core/Tests/Unit/DataHandling/SlugHelperTest.php 12 additions, 0 deletionstypo3/sysext/core/Tests/Unit/DataHandling/SlugHelperTest.php
- typo3/sysext/core/Tests/Unit/Slug/SlugNormalizerTest.php 143 additions, 0 deletionstypo3/sysext/core/Tests/Unit/Slug/SlugNormalizerTest.php
Please register or sign in to comment