Deprecation: #109544 - GeneralUtility::sanitizeLocalUrl() needs PSR-7 request 

See forge#109544

Description 

Calling \TYPO3\CMS\Core\Utility\GeneralUtility::sanitizeLocalUrl() without passing the current PSR-7 request as second argument is deprecated. The method previously resolved host and site information via GeneralUtility::getIndpEnv(), which falls back to server superglobals. Passing the request explicitly allows the method to read this information from \TYPO3\CMS\Core\Http\NormalizedParams instead.

Impact 

Calling GeneralUtility::sanitizeLocalUrl() with only one argument triggers a PHP E_USER_DEPRECATED error.

Affected installations 

All installations that call GeneralUtility::sanitizeLocalUrl() without passing a \Psr\Http\Message\ServerRequestInterface as second argument.

The extension scanner will detect affected usages as a strong match.

Migration 

Pass the current PSR-7 request as second argument:

// Before
$url = GeneralUtility::sanitizeLocalUrl($url);

// After
$url = GeneralUtility::sanitizeLocalUrl($url, $request);
Copied!