Project

General

Profile

Actions

Bug #95833

closed

HtmlParser throws exception in PHP 8.0

Added by Tomas Norre Mikkelsen over 2 years ago. Updated over 2 years 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 1 (0 open1 closed)

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

Actions
Actions #1

Updated by Tomas Norre Mikkelsen over 2 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
Actions #2

Updated by Tomas Norre Mikkelsen over 2 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.

Actions #3

Updated by Wouter Wolters over 2 years ago

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

Updated by Wouter Wolters over 2 years ago

  • Status changed from New to Closed

Closed as duplicate of #95738

Actions

Also available in: Atom PDF