Bug #95833
closedHtmlParser throws exception in PHP 8.0
0%
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.
Updated by Tomas Norre Mikkelsen about 3 years ago
For other pages I have
PHP Warning: Undefined array key "defer" in /var/www/html/public/typo3/sysext/core/Classes/Page/PageRenderer.php line 2213
Updated by Tomas Norre Mikkelsen about 3 years ago
Setting my setup to Live "Turn off debug output and set logging to warnings and errors only."
It works like expected. So this is probably already in the pipeline, for somewhen when the support is PHP 8.0+.
Think this can be closed again.
Updated by Wouter Wolters about 3 years ago
- Is duplicate of Task #95738: Make HtmlParser compatible with PHP 8 added
Updated by Wouter Wolters about 3 years ago
- Status changed from New to Closed
Closed as duplicate of #95738