Issue Bug Closed

#96537PHP Warning: Undefined array key "casesensitiveComp" in ... HTMLParser.php line 555 (PHP 8)

Tobias Pfender 01/14/22, 10:16 updated 07/09/24, 12:45

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