Deprecation: #95395 - GeneralUtility::isAllowedHostHeaderValue() and TRUSTED_HOSTS_PATTERN constants

See forge#95395

Description

The PHP method TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedHostHeaderValue() and the PHP constants TYPO3\CMS\Core\Utility\GeneralUtility::ENV_TRUSTED_HOSTS_PATTERN_ALLOW_ALL and TYPO3\CMS\Core\Utility\GeneralUtility::ENV_TRUSTED_HOSTS_PATTERN_SERVER_NAME have been deprecated.

Impact

A deprecation will be logged in TYPO3 v11 if TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedHostHeaderValue() is used. It is unlikely for extensions to have used this as the host header is checked for every frontend and backend request anyway.

Usage of the constants will cause a PHP error "Undefined class constant" in TYPO3 v12, the method TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedHostHeaderValue() will be dropped without replacement.

Affected Installations

Installations using the constants instead of static strings or call the method explictily – which is unlikely.

Migration

Use '.*' instead of TYPO3\CMS\Core\Utility\GeneralUtility::ENV_TRUSTED_HOSTS_PATTERN_ALLOW_ALL and 'SERVER_NAME' instead of TYPO3\CMS\Core\Utility\GeneralUtility::ENV_TRUSTED_HOSTS_PATTERN_SERVER_NAME.

Don't use TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedHostHeaderValue().