Issue Bug Closed

#99269ContentObjectRenderer public function http_makelinks php 8.x Error and strange behavior at least since TYPO3 8LTS

Sven Ignor 12/05/22, 09:50 updated 03/01/23, 14:42

Description

Editor content (Certainly not the best example, but that’s how it happened):

<p>Sofern das Modul <em>handle</em> korrekt eingebunden wurde, erscheint die Statusmeldung: „Server is available under http://127.0.0.1:8080“<em>. </em>Rufen Sie diese Adresse auf, erhalten Sie: „Hello World!“.</p>

tested in TYPO3 8,10,11LTS:

What is happening:
Some of the text disappears as long as the <em>. </em> is present:

<p>Sofern das Modul <em>handle</em> korrekt eingebunden wurde, erscheint die Statusmeldung: „Server is available under <a target="_blank"></a><em>. </em>Rufen Sie diese Adresse auf, erhalten Sie: „Hello World!“.</p>

Removing the <em>. </em> results in the following output:

<p>Sofern das Modul <em>handle</em> korrekt eingebunden wurde, erscheint die Statusmeldung: „Server is available under <a href="http://http://127.0.0.1:8080“" target="_blank" rel="noreferrer">http://http://127.0.0.1:8080“</a>. Rufen Sie diese Adresse auf, erhalten Sie: „Hello World!“.</p>

With stricter error handling in php8+, error messages appear in the frontend because http_makelinks is trying to access parts[‘host’] etc., but $parts has the value FALSE.

(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Trying to access array offset on value of type bool in /var/www/html/public/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 3943

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.