86543[BUGFIX] Prevent undefined array key access in 'removeTags' parsing
Commit message
Review
-
Code review CR +2 Done
- Garvin Hicking +2
- Benjamin Franzke +1
- Georg Tiefenbrunn +1
- Oli Bartsch +1
- Oliver Hader +1
-
Verified V +2 Done
- Garvin Hicking +2
- Benjamin Franzke +1
- Georg Tiefenbrunn +1
- Oli Bartsch +1
- core-ci +1 CI
Issues 2
Files 4
- typo3/sysext/core/Classes/Html/HtmlParser.php5+12 −13
- typo3/sysext/rte_ckeditor/Tests/Functional/Fixtures/rte-pages-array.csvnew+9 −0
- typo3/sysext/rte_ckeditor/Tests/Functional/Fixtures/rte-pages-string.csvnew+3 −0
- typo3/sysext/rte_ckeditor/Tests/Functional/HtmlParser/HtmlParserProcessingTest.php+92 −2
Review log 1925
-
Garvin Hicking uploaded patch set 1 10/10/24, 06:15
-
Garvin Hicking updated the commit message in patch set 2 10/10/24, 06:16
-
core-ci voted on patch set 1 V +1 10/10/24, 06:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67475
-
core-ci voted on patch set 2 V +1 10/10/24, 06:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67476
-
Oli Bartsch voted on patch set 2 CR +1 V +1 10/10/24, 06:29
-
Benjamin Franzke commented on patch set 2 10/10/24, 07:09
-
Garvin Hicking uploaded patch set 3
CR +1V +110/10/24, 07:13 -
Garvin Hicking commented on patch set 3 10/10/24, 07:16
HtmlParser.php:957ReplyI've just added tests for parsing the TSconfig notation, in which the application seems to work with a TS array assignment. Could you help me figure this out how I would need to adapt the test for the case you describe? -
core-ci voted on patch set 3 V -1 10/10/24, 07:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67478
-
Garvin Hicking uploaded patch set 4
V -110/10/24, 07:28CGL -
core-ci voted on patch set 4 V +1 10/10/24, 07:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67480
-
Benjamin Franzke commented on patch set 3 10/10/24, 07:44
HtmlParser.php:957ReplyHad to track this down myself as well. `removeTags` gets value `1` assigned by `TYPO3\CMS\Core\Configuration\Richttext::convertPlainArrayToTypoScriptArray` when transforming RTE yaml config into a TSconfig-like array. That means: `removeTags=1` is not assigned when the default rte_ckeditor `typo3/sysext/rte_ckeditor/Configuration/RTE/Processing.yaml` config is not used, otherwise – although being overwritten – `removeTags=1` is written due to the yaml configuration. -
Garvin Hicking commented on patch set 4 10/10/24, 07:52
HtmlParser.php:957ReplySo if I understand correctly, we would need to change ``` if (!empty($TSconfig['removeTags'])) { ``` to ``` if (!empty($TSconfig['removeTags']) || !empty($TSconfig['removeTags.'])) { ``` right? -
Garvin Hicking uploaded patch set 5
V +110/10/24, 14:13 -
core-ci voted on patch set 5 V +1 10/10/24, 14:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67513
-
Garvin Hicking uploaded patch set 6
V +110/10/24, 14:20Additional test -
Garvin Hicking commented on patch set 5 10/10/24, 14:21
@ben@bnf.dev I have refactored this due to the findings that we must not test inline-tag removal at block-level, because RteHtmlParser->TS_transform_db() is the one doing that, not the methods we're testing with 'removeTags'. Before, my patch just worked thanks to that, and not the "real removeTags" logic. I've now added both block-level and inline-level testing, so that the removeTags logic actually is utilized. I also included your variant of the changed $removeTagsArray logic, which is way more readable. Thank you. I am unsure whether we need to include your extension fixture approach to disable htmlSanitize to verify untampered data. Please advise, if you want that, I can include it here. -
Garvin Hicking commented on patch set 6 10/10/24, 14:21
HtmlParser.php:957Reply(Changed logic to WIP variant from Benjamin, thanks) -
core-ci voted on patch set 6 V +1 10/10/24, 14:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67514
-
Benjamin Franzke commented on patch set 6 CR +1 V +1 10/10/24, 14:37
Reply
Thanks, this is good to go. -
Oliver Hader voted on patch set 6 CR +1 10/10/24, 17:34
-
Georg Tiefenbrunn commented on patch set 6 CR +1 V +1 10/11/24, 06:25
Thank you for the quick fix! -
Oli Bartsch voted on patch set 6 CR +1 V +1 10/11/24, 06:52
-
Garvin Hicking voted on patch set 6 CR +2 V +2 10/11/24, 07:09
-
Garvin Hicking merged patch set 7 10/11/24, 07:09
HtmlParser.php:957