87457[FEATURE] Allow boolean and arbitrary values in HTML attributes
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Benni Mack +1
-
Verified V +2 Done
- Georg Ringer +2
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 13
- typo3/sysext/core/Classes/MetaTag/AbstractMetaTagManager.php1+9 −6
- typo3/sysext/core/Classes/MetaTag/GenericMetaTagManager.php+9 −6
- typo3/sysext/core/Classes/Page/AssetRenderer.php+1 −1
- typo3/sysext/core/Classes/Page/JavaScriptRenderer.php+1 −1
- typo3/sysext/core/Classes/Page/PageRenderer.php+5 −5
- typo3/sysext/core/Classes/Resource/Rendering/AudioTagRenderer.php+13 −16
- typo3/sysext/core/Classes/Resource/Rendering/VideoTagRenderer.php1+15 −25
- typo3/sysext/core/Classes/Utility/GeneralUtility.php4+40 −6
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-110769-AllowBooleanAndArbitraryValuesInHtmlAttributes.rstnew+64 −0
- typo3/sysext/core/Tests/Unit/Resource/Rendering/AudioTagRendererTest.php+5 −0
- typo3/sysext/core/Tests/Unit/Resource/Rendering/VideoTagRendererTest.php+5 −0
- typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php+98 −0
- typo3/sysext/frontend/Classes/Http/RequestHandler.php+5 −7
Review log 1723
-
Ayke Halder uploaded patch set 1 12/11/24, 17:39
-
Ayke Halder commented on patch set 1 12/11/24, 17:40
Rebase of closed 76103: [WIP][TASK] Allow arbitrary values in attributes | https://review.typo3.org/c/Packages/TYPO3.CMS/+/76103/4 -
core-ci voted on patch set 1 V -1 12/11/24, 17:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70968
-
Ayke Halder uploaded patch set 2
V -112/11/24, 18:31 -
core-ci voted on patch set 2 V -1 12/11/24, 18:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70972
-
Ayke Halder uploaded patch set 3
V -112/11/24, 18:50 -
core-ci voted on patch set 3 V +1 12/11/24, 18:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70977
-
Ayke Halder commented on patch set 3 12/11/24, 19:08
Patchset 1 -> 3 just implements fixes to make Core CI happy: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87457/1..3 Especially it should be evaluated if activating attribute-name conversion to lower-case letters is the intended behaviour: E.g. `$attr['CustomAttribute' => 'test']` becomes `<tag customattribute="test">` -
Ayke Halder uploaded patch set 4
V +112/11/24, 19:17 -
core-ci voted on patch set 4 V +1 12/11/24, 19:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70980
-
Ayke Halder commented on patch set 4 12/11/24, 19:44
Patchset 4 implements changes to the attribute mapping: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87457/3..4 See `GeneralUtilityTest::implodeAttributesArbitraryDataProvider`: ---- ```php $attr = [ 'href' => 'https://example.com';, 'title' => 'test', 'aria-hidden' => 'true', 'defer' => true, 'disabled' => true, 'nomodule' => true ]; ``` Result: `href="https://example.com" title="test" aria-hidden="true" defer disabled nomodule` ---- ```php $attr = [ 'href' => 'https://example.com';, 'title' => '', 'aria-hidden' => 'false', 'defer' => false, 'disabled' => true, 'nomodule' => null ]; unset($attr['disabled']); ``` Result: `href="https://example.com" aria-hidden="false"` -
Benni Mack uploaded patch set 5
V +109/23/26, 20:51 -
Benni Mack marked it ready for review 09/23/26, 20:52
-
core-ci voted on patch set 5 V +1 09/23/26, 21:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109114
-
Benni Mack updated the commit message in patch set 6
V +109/28/26, 12:44 -
Benni Mack voted on patch set 6 CR +1 V +1 09/28/26, 12:44
-
core-ci voted on patch set 6 V +1 09/28/26, 12:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109421
-
Georg Ringer voted on patch set 6 CR +2 V +2 09/30/26, 07:31
-
Georg Ringer merged patch set 7 09/30/26, 07:31
-
Torben Hansen commented on patch set 7 09/30/26, 08:47
Sorry for being late at the party. I think we should continue to escape the keys of possible `data-` attributes in the VideoTagRenderer and AudioTagRenderer. AFAICs this is not handled somewhere else now.VideoTagRenderer.php:73UnresolvedWhy has the escaping of the key been removed? -
Ayke Halder commented on patch set 7 09/30/26, 09:55
Reply Unresolved
Good point! This change is from December 2024… and then got rebased in 2026. ---- On one hand we might want to escape all keys directly inside ̀GeneralUtility::implodeAttributes()`. On the other hand: Just don't escape the HTML attributes as nearly every character is allowed! Just clean those non-viable control-characters: `='">` and ` ` (all kind of blanks) See https://stackoverflow.com/questions/925994/what-characters-are-allowed-in-an-html-attribute-name/53563849#53563849AbstractMetaTagManager.php:233UnresolvedE.g. here the keys are escaped before calling `GeneralUtility::implodeAttributes()`GeneralUtility.php:1001UnresolvedEscape the keys here…GeneralUtility.php:1019… and also escape the keys here. -
Ayke Halder commented on patch set 7 09/30/26, 09:58
GeneralUtility.php:1019ReplyNot here.GeneralUtility.php:1021Unresolved… and also escape the keys here. -
Benni Mack commented on patch set 7 10/02/26, 16:35
Thanks for the feedback @mail@ayke-halder.de and @derhansen@gmail.com - I did a followup here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/96323