#96537PHP Warning: Undefined array key "casesensitiveComp" in ... HTMLParser.php line 555 (PHP 8)
Description
While updating a few systems to TYPO3 11 and PHP 8, I noticed this warning:
PHP Warning: Undefined array key “casesensitiveComp” in /var/www/html/htdocs/typo3/sysext/core/Classes/Html/HtmlParser.php line 555
We use the following typoscript snippet to filter out span tags with shy class:
// Remove any 'shy' classes from <span> elements:
lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.span.fixAttrib.class.removeIfEquals = shy
// Remove all <span> elements which have no attribute:
lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.rmTagIfNoAttrib = span
To reproduce this warning, enable span tags in your rte editor, paste the typoscript snippet into you ts and create a text element with a test
I tried to trace it back and I think the problem lies in HtmlParser->HTMLparserConfig. When I add lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.span.fixAttrib.casesensitiveComp = 0 to my typoscript, this methode removes it from the config.
Reviews 5
- 11.5 81047[BUGFIX] Avoid undefined array key 'casesensitiveComp'
- 12.4 81048[BUGFIX] Avoid undefined array key 'casesensitiveComp'
- main 80982[BUGFIX] Avoid undefined array key 'casesensitiveComp'
- 11.5 73088[BUGFIX] Avoid undefined array key 'casesensitiveComp'
- main 73098[BUGFIX] Avoid undefined array key 'casesensitiveComp'