Skip to content

Commit

Permalink
[BUGFIX] Fix undefined array key warning in HtmlParser
Browse files Browse the repository at this point in the history
Resolves: #97095
Releases: main, 11.5
Change-Id: I783dab0b2d16d8071a2ecd061083a580f77533b2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73780
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
André Buchmann authored and lolli42 committed Mar 4, 2022
1 parent d31ea25 commit 99f8576
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typo3/sysext/core/Classes/Html/HtmlParser.php
Expand Up @@ -529,7 +529,7 @@ public function HTMLcleaner($content, $tags = [], $keepAll = 0, $hSC = 0, $addCo
// Classes are case sensitive
if ($attr === 'class') {
$newClasses = [];
$classes = GeneralUtility::trimExplode(' ', $tagAttrib[0][$attr], true);
$classes = GeneralUtility::trimExplode(' ', $tagAttrib[0][$attr] ?? '', true);
foreach ($classes as $class) {
if (in_array($class, $params['list'])) {
$newClasses[] = $class;
Expand All @@ -541,7 +541,7 @@ public function HTMLcleaner($content, $tags = [], $keepAll = 0, $hSC = 0, $addCo
$tagAttrib[0][$attr] = $params['list'][0];
}
} else {
if (!in_array($this->caseShift($tagAttrib[0][$attr], $params['casesensitiveComp'] ?? false), (array)$this->caseShift($params['list'], $params['casesensitiveComp'], $tagName))) {
if (!in_array($this->caseShift($tagAttrib[0][$attr] ?? '', $params['casesensitiveComp'] ?? false), (array)$this->caseShift($params['list'], $params['casesensitiveComp'], $tagName))) {
$tagAttrib[0][$attr] = $params['list'][0];
}
}
Expand Down

0 comments on commit 99f8576

Please sign in to comment.