#98175Option fixAttrib.[attribute].prefixRelPathWith of HTMLParser throws warning since PHP 8
Description
If fixAttrib.[attribute].prefixRelPathWith is configured for let’s say a image, there might be a warning like “ PHP Warning: Undefined array key “scheme” in …/typo3/sysext/core/Classes/Html/HtmlParser.php line 574 “
If you look at the code it’s obvious.
if ($params['prefixRelPathWith'] ?? false) {
$urlParts = parse_url($tagAttrib[0][$attr]);
if (!$urlParts['scheme'] && $urlParts['path'][0] !== '/') {
// If it is NOT an absolute URL (by http: or starting "/")
$tagAttrib[0][$attr] = $params['prefixRelPathWith'] . $tagAttrib[0][$attr];
}
}
If prefixRelPathWith is set the given URL will likely be a local one without a scheme leading to said warning.