Commit a594307a authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[BUGFIX] Avoid undefined array key 'casesensitiveComp'

Using null coalescing operator with fallback to 'false'
to avoid undefined array key access warnings when key
'casesensitiveComp' is not set. Using 'false' here as
this matches the behaviour of <PHP8.0, and as this is
used as method argument of type bool a bool typecase
is added along the way to be on the safe side.

Resolves: #96537
Releases: main, 11.5
Change-Id: I3c4df09b2adf5eec57e31947189f4a1e2aea4bd2
parent fc95fe87
Pipeline #22350 passed with stages
in 11 minutes and 38 seconds
......@@ -551,7 +551,10 @@ class HtmlParser
) {
unset($tagAttrib[0][$attr]);
}
if ((string)($params['removeIfEquals'] ?? '') !== '' && $this->caseShift($tagAttrib[0][$attr], $params['casesensitiveComp']) === $this->caseShift($params['removeIfEquals'], $params['casesensitiveComp'])) {
if (
(string)($params['removeIfEquals'] ?? '') !== ''
&& $this->caseShift($tagAttrib[0][$attr], (bool)($params['casesensitiveComp'] ?? false)) === $this->caseShift($params['removeIfEquals'], (bool)($params['casesensitiveComp'] ?? false))
) {
unset($tagAttrib[0][$attr]);
}
if ($params['prefixRelPathWith'] ?? false) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment