Issue Bug Closed

#95833HtmlParser throws exception in PHP 8.0

Tomas Norre Mikkelsen 10/31/21, 14:58 updated 11/01/21, 09:47

Description

When running the Crawler devbox with PHP 8.0 and TYPO3 11.5.1 I get the following error when opening the frontend in the browser.

PHP Warning: Undefined array key "fixAttrib" in /var/www/html/public/typo3/sysext/core/Classes/Html/HtmlParser.php line 916
if (!is_array($keepTags[$key]['fixAttrib'][$atName])) {
    $keepTags[$key]['fixAttrib'][$atName] = [];
}

When fixing that with

if (!isset($keepTags[$key]['fixAttrib'][$atName]) || !is_array($keepTags[$key]['fixAttrib'][$atName])) {
    $keepTags[$key]['fixAttrib'][$atName] = [];
}

I run into the next exception

PHP Warning: Undefined array key "range" in /var/www/html/public/typo3/sysext/core/Classes/Html/HtmlParser.php line 920
if ((string)$keepTags[$key]['fixAttrib'][$atName]['range'] !== '') {
    $keepTags[$key]['fixAttrib'][$atName]['range'] = GeneralUtility::trimExplode(',', $keepTags[$key]['fixAttrib'][$atName]['range']);
}

And so it continues.

My devbox is based on:

bk2k/bootstrap-package 12.0.3
typo3/cms-introduction 4.4.1

this is tested with the dev-master from today (31.10.21)

I don’t expect it to be something in my setup. But as it’s not a TYPO3 pure, but has other components in it too, I can not exclude that possiblity.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.