Bug #95833

HtmlParser throws exception in PHP 8.0

Added by Tomas Norre Mikkelsen 8 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2021-10-31
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues

Is duplicate of TYPO3 Core - Task #95738: Make HtmlParser compatible with PHP 8Resolved2021-10-23

Actions
#1

Updated by Tomas Norre Mikkelsen 8 months 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
#2

Updated by Tomas Norre Mikkelsen 8 months 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.

#3

Updated by Wouter Wolters 8 months ago

  • Is duplicate of Task #95738: Make HtmlParser compatible with PHP 8 added
#4

Updated by Wouter Wolters 8 months ago

  • Status changed from New to Closed

Closed as duplicate of #95738

Also available in: Atom PDF