diff --git a/typo3/sysext/core/Classes/Utility/ClientUtility.php b/typo3/sysext/core/Classes/Utility/ClientUtility.php index 429e65cfbea20f711f6b5c89d3d85d8b0d6350b3..22e2f1d2bcc053be7d00fdaae9158b89bca59fd3 100644 --- a/typo3/sysext/core/Classes/Utility/ClientUtility.php +++ b/typo3/sysext/core/Classes/Utility/ClientUtility.php @@ -24,9 +24,11 @@ class ClientUtility * * @param string $userAgent The useragent string, \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_USER_AGENT') * @return array Contains keys "browser", "version", "system + * @deprecated */ public static function getBrowserInfo($userAgent) { + trigger_error('Method getBrowserInfo() is deprecated since v9 and will be removed with v10', E_USER_DEPRECATED); // Hook: $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/div/class.t3lib_utility_client.php']['getBrowserInfo']: $getBrowserInfoHooks = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/div/class.t3lib_utility_client.php']['getBrowserInfo']; if (is_array($getBrowserInfoHooks)) { @@ -174,9 +176,11 @@ class ClientUtility * * @param string $version A string with version number, eg. "/7.32 blablabla * @return float Returns double value, eg. "7.32 + * @deprecated */ public static function getVersion($version) { + trigger_error('Method getVersion() is deprecated since v9 and will be removed with v10', E_USER_DEPRECATED); return (float)preg_replace('/^[^0-9]*/', '', $version); } } diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82903-DeprecateClientUtility.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82903-DeprecateClientUtility.rst new file mode 100644 index 0000000000000000000000000000000000000000..3d0e33533891556dd77474fd3377705ea33952c3 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82903-DeprecateClientUtility.rst @@ -0,0 +1,36 @@ +.. include:: ../../Includes.txt + +============================================= +Deprecation: #82903 - Deprecate ClientUtility +============================================= + +See :issue:`82903` + +Description +=========== + +Class :php:`\TYPO3\CMS\Core\Utility\ClientUtility` has been marked as deprecated and should not be +used any longer. + + +Impact +====== + +Using this class will throw a deprecation warning. + + +Affected Installations +====================== + +Instances with extensions using the methods of the class: + +- :php:`getBrowserInfo` +- :php:`getVersion` + + +Migration +========= + +Use a 3rd party API like https://github.com/piwik/device-detector + +.. index:: FullyScanned diff --git a/typo3/sysext/core/Tests/Unit/Utility/ClientUtilityTest.php b/typo3/sysext/core/Tests/Unit_Deprecated/Utility/ClientUtilityTest.php similarity index 100% rename from typo3/sysext/core/Tests/Unit/Utility/ClientUtilityTest.php rename to typo3/sysext/core/Tests/Unit_Deprecated/Utility/ClientUtilityTest.php diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php index 5b144b73983afc6b48cfe18ce471ba258aad6a7c..f29b2401e96619e04fe2bc0de935fb79e96f242c 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php @@ -442,6 +442,11 @@ return [ 'Deprecation-82805-RenamedAjaxLoginHandlerPHPClass.rst', ], ], + 'TYPO3\CMS\Core\Utility\ClientUtility' => [ + 'restFiles' => [ + 'Deprecation-82903-DeprecateClientUtility.rst', + ], + ], // Removed interfaces 'TYPO3\CMS\Backend\Form\DatabaseFileIconsHookInterface' => [