74473[BUGFIX] Allow allowedAttribs HTMLParser as either string or array
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Garvin Hicking +1
-
Verified V +2 Done
- Benni Mack +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 4
Files 6
- typo3/sysext/core/Classes/Html/HtmlParser.php5+17 −15
- typo3/sysext/core/Tests/Unit/Html/HtmlParserTest.php+40 −7
- typo3/sysext/rte_ckeditor/Configuration/RTE/Processing.yaml10+3 −2
- typo3/sysext/rte_ckeditor/Tests/Functional/Fixtures/RteConfigArrayFixtureProcessing.yaml+14 −0
- typo3/sysext/rte_ckeditor/Tests/Functional/Fixtures/RteConfigStringFixtureProcessing.yaml+10 −0
- typo3/sysext/rte_ckeditor/Tests/Functional/HtmlParser/HtmlParserProcessingTest.php+83 −0
Review log 5169
Show 3444 earlier messages
-
Eric Harrer uploaded patch set 1 04/28/22, 08:50
-
core-ci voted on patch set 1 V +1 04/28/22, 09:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26562
-
Stefan Bürk commented on patch set 1 04/28/22, 12:30
Thanks for contributiong your first patch. I have added a small comment which should be addressed. Honestly, I did not checked/debugged if it really comes as array to the stated HtmlParser::HTMLcleyner() method, but if it is so this change is legimit as bugfix. Additionally we could think about making this an "array" notation, which would be a Feature and v12 then. (as dedicated follow up patch). Generally, 10.4 is in security/priority bugfix mode which means that not all changes and bugfixes are backported to v10 anymore. Granted, this one is quite small and should only have a minimum affect as it seems to be a more edge case that someone tries to add classes on the hr-tag. ANd it can be fixed by changing the default definition anyway. So, generall spoken the commit release line should be changed to "main, 11.5".Processing.yaml:80I think, we should adopt the "array notation -> string notation" change for the comment also. Additional enricht it with a short descripting that it is a comma seperated list. Would do you think about using here `allowTags: "%default%" # comma separated list, eg. "class,style" -
Nikita Hovratov commented on patch set 1 04/28/22, 12:43
Nice finding! I think it's not a critical bug, so let's remove the backport for v10. -
Nikita Hovratov commented on patch set 1 04/28/22, 12:55
Processing.yaml:80ReplyI think the comment is not related to this attribute. Btw: This is documented in https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/HtmlparserTags.html#allowedattribs Instead of commenting every so small property, we should refer to the documentation for more details. Maybe on the top of the file? -
Stefan Bürk commented on patch set 1 04/28/22, 13:02
Processing.yaml:80ReplyAck. -
Eric Harrer commented on patch set 1 04/28/22, 13:22
Reply
AckProcessing.yaml:80ReplyI think we should only reference to https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/PageTsconfig/Rte.html instead on the top of the file since it contains every option that can be chosen here for "processing". From there one can follow option "HTMLparser_db" with type "HTMLparser" (https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/Htmlparser.html) and from there one can follow option "tags" with type "boolean/HTMLparser_tags" to finally get infos for option "allowedAttribs" https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/HtmlparserTags.html#allowedattribs -
Stefan Bürk commented on patch set 1 04/28/22, 13:24
Processing.yaml:80Reply@Eric corret. the overall documentation, not the allowAttribs one, should be on the start of the file. Would you take care and adjust the patch ? -
Eric Harrer commented on patch set 1 04/28/22, 13:34
Processing.yaml:80ReplyI added the change. One disadvantage in this context is that the documentation refers to TSconfig and not to the YAML format. -
Nikita Hovratov commented on patch set 1 04/28/22, 13:38
Processing.yaml:80ReplyThe documentation hasn't been adopted to yaml (yet). But I think it's better than nothing at all. -
Eric Harrer commented on patch set 1 04/28/22, 13:45
Processing.yaml:80ReplyI found the following documentation of the "processing" option: https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/Configuration/Reference.html#processing this documentation currently does not contain a link to the actual options Maybe we should reference that instead? Or both? -
Eric Harrer commented on patch set 2 04/28/22, 13:51
Published edit on patch set 1. -
Eric Harrer updated the commit message in patch set 3 04/28/22, 13:52
-
Nikita Hovratov commented on patch set 3 V +1 CR +1 04/28/22, 14:07
Processing.yaml:80ReplyLet's add a link in the documentation then. But I think the link you inlcuded is sufficient for now. -
Eric Harrer commented on patch set 3 04/28/22, 14:09
Processing.yaml:80ReplyI think that for now it is sufficient to just link the TSconfig options since it brings the greatest added value. -
core-ci voted on patch set 3 V -1 04/28/22, 14:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26595
-
Eric Harrer voted on patch set 3 V +1 CR +1 04/28/22, 14:10
-
Nikita Hovratov commented on patch set 3 04/28/22, 14:13
Hey Eric, the rules are that one does not vote for his/her own patch. Can you remove your votes please? -
Eric Harrer commented on patch set 3 V 0 CR 0 04/28/22, 14:15
Reply
Oh, sorry for that, will be removed. -
Eric Harrer commented on patch set 3 04/28/22, 14:16
> Patch Set 3: Verified-1 > > Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26595 Can anyone tell me how to correct this problem? Unfortunately I don't quite understand it. -
core-ci voted on patch set 2 V -1 04/28/22, 14:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26594
-
Nikita Hovratov commented on patch set 3 04/28/22, 14:20
Reply
Just a hiccup, I restarted the test. -
core-ci voted on patch set 2 V +1 04/28/22, 14:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26594
-
Nikita Hovratov rebased onto patch set 4 04/28/22, 14:30
-
Nikita Hovratov voted on patch set 4 V +1 CR +1 04/28/22, 14:30
-
core-ci voted on patch set 4 V +1 04/28/22, 14:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26607
-
core-ci voted on patch set 3 V +1 04/28/22, 16:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26595
-
Nikita Hovratov uploaded patch set 5 04/28/22, 16:20
-
Nikita Hovratov voted on patch set 5 V +1 CR +1 04/28/22, 16:21
-
Eric Harrer commented on patch set 5 04/28/22, 16:36
Reply
Thanks, do I need to do any further intervention for this patch to be merged or is it just about waiting for further upvotes?Does this patch needs any further intervention from my side? -
core-ci voted on patch set 5 V +1 04/28/22, 16:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26615
-
Stefan Bürk commented on patch set 5 V +1 CR +1 04/28/22, 16:40
Reply
> Can anyone tell me how to correct this problem? Unfortunately I don't quite understand it. That's okay - we also not really (yet). We are still investigating this ssl hickup issue. So if you have such ssl failures on pipeline, just ask in slack in the #typo3-cms-coredev channel if someone can restart/retry the failed job/pipeline. -
Nikita Hovratov commented on patch set 5 04/28/22, 17:13
Reply
Nope, just chill and wait. It has +2/+2 now from core mergers and CI is green. It is now ready to be merged, which will happen soon. -
Benni Mack commented on patch set 5 CR -1 04/28/22, 20:34
Thanks Eric, for raising up the topic. Shouldn't we migrate this to an array? Or at least allow RteHtmlparser to deal with strings AND arrays? I am pretty sure there is also an older issue in forge around dealing with this problem. -
Stefan Bürk commented on patch set 5 04/28/22, 20:40
Reply
^ Would we do that "string" and "array" then as "bugfix" ? I thought about using this "as bugfix" and doing the string/array opening / transition on v12 only (v12). This bugfix fixes the wrong default yml file, which is not in the shape the documentation already states. So I think this is a valid bugfix. And opening/changing it to be an array like the others (or dual mode) should be v12 only thing - or am I wrong, Benni ? However, noted older issue would be interessting. -
Eric Harrer updated the commit message in patch set 6 04/29/22, 14:12
-
Nikita Hovratov voted on patch set 6 V +1 CR +1 04/29/22, 14:14
-
core-ci voted on patch set 6 V +1 04/29/22, 14:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26675
-
Eric Harrer uploaded patch set 7 04/29/22, 14:53
-
Eric Harrer updated the commit message in patch set 8 04/29/22, 14:55
-
core-ci voted on patch set 7 V +1 04/29/22, 15:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26677
-
core-ci voted on patch set 8 V +1 04/29/22, 15:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26678
-
Eric Harrer updated the commit message in patch set 9 04/29/22, 15:13
-
Eric Harrer commented on patch set 9 04/29/22, 15:13
Reply
I updated the HtmlParser as recommended in related forge issue #96485 and tested it sucessfully by myself. Now it is possible to define a comma separated list (string) OR an array in the YAML file for option allowedAttribs. For this reason I resetted the originally affected line in the YAML file. Looking at the HtmlParser code it seems as it was already intended to do so. So this can be considered a bugfix I think.
-
core-ci voted on patch set 9 V +1 04/29/22, 15:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26679
-
Benni Mack voted on patch set 9 CR +1 05/02/22, 10:36
-
Oliver Hader commented on patch set 9 05/02/22, 11:04
This one is interesting... The change has been introduced in 2005(!), see https://github.com/TYPO3/typo3/commit/ca9414154ebc238a62e01c5209659ee3611f9e43#diff-0abcd5ed69ee1f6b1bc06d937f47d218ce1fbd2fb86605e26887c98b5cb9269cR643-R646 And besides that there are a bunch of other handling directives that are not considered correctly, see https://review.typo3.org/c/Packages/TYPO3.CMS/+/74498 (this change was planned to be released as security fix, however `typo3/html-sanitizer` has been used in favor of preferring allow-lists over deny-lists like `removeTags`) -
Oliver Hader commented on patch set 9 CR -1 05/02/22, 11:09
On it.. -
Oliver Hader uploaded patch set 10 05/02/22, 11:21
-
Oliver Hader commented on patch set 10 CR -1 05/02/22, 11:23
HtmlParser.php:471The tests added in patch-set 10 will fail - basically due to this condition. The array-directive is only processed in case there is the list-directive as well - that's only possible with plain TypoScript, but not with YAML. -
Oliver Hader commented on patch set 10 05/02/22, 11:29
HtmlParser.php:480Previous `_allowedAttribs` shoud be used as "local cache" (probably never worked). Thus, in general when having both an array-directive AND a list-directive, we need to decide which declaration takes precedence... (usually array should win, since it reflects the newer declarative approach using YAML) -
core-ci voted on patch set 10 V -1 05/02/22, 11:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26723
-
Oliver Hader uploaded patch set 11 05/02/22, 13:10
-
core-ci voted on patch set 11 V -1 05/02/22, 13:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26727
-
core-ci commented on patch set 11 05/02/22, 13:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26727
-
Benni Mack updated the commit message in patch set 12
V -105/03/23, 09:17 -
core-ci voted on patch set 12 V -1 05/03/23, 09:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41390
-
Oliver Hader rebased onto patch set 13
V -105/03/23, 11:54 -
core-ci voted on patch set 13 V -1 05/03/23, 12:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41521
-
Benni Mack updated the commit message in patch set 14
V -110/18/24, 14:07 -
Garvin Hicking uploaded patch set 15 02/17/25, 17:24
-
Garvin Hicking commented on patch set 15 02/17/25, 17:26
HtmlParser.php:480ReplyI would like to continue this here now that I worked on it with https://review.typo3.org/c/Packages/TYPO3.CMS/+/88244 && https://review.typo3.org/c/Packages/TYPO3.CMS/+/85137 I would agree on this patch and in case on a class, the ARRAY-directive should IMO take precedence. We could also think about logging an error in this case (throwing an exception might be too intrusive?). Removing `_allowedAttribs` looks good to me, couldn't find another usage. Once the tests mentioned above are merged, I could add a better distinction of YAML vs. TS checks (these now have their own entrypoints) which should allow testing the list vs. array thing more cleanly. Anyone interested in wrapping this up? Feel free to ping me on slack, or discuss it here. -
core-ci voted on patch set 15 V -1 02/17/25, 17:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74260
-
Garvin Hicking uploaded patch set 16
V -103/25/25, 09:09 -
core-ci voted on patch set 16 V +1 03/25/25, 09:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76220
-
Garvin Hicking commented on patch set 16 CR +1 V +1 03/25/25, 09:26
HtmlParser.php:471ReplyDoneHtmlParser.php:480ReplyI've reworked this patch and added it into the test coverage of the tests introduced with the two patches mentioned above. Happy for review(s). -
Benni Mack commented on patch set 16 CR +1 V +1 03/25/25, 09:31
Thanks for taking care! -
Benni Mack voted on patch set 16 CR +2 V +2 03/25/25, 09:50
-
Benni Mack merged patch set 17 03/25/25, 09:51