[TASK] Remove dependency on TYPO3 ClientUtility 68/57668/2
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 24 Jul 2018 05:01:40 +0000 (01:01 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 24 Jul 2018 05:03:04 +0000 (07:03 +0200)
TYPO3 Core ClientUtility is removed in TYPO3 9.

Resolves: #85629
Change-Id: Ia420e810214830b66ce1f4d2997fc6f6edd7f11c
Reviewed-on: https://review.typo3.org/57668
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
ChangeLog
Classes/ViewHelpers/AudioViewHelper.php

index bc3e7d9..c402e4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2018-07-24  Stanislas Rolland  <typo(arobas)sjbr.ca>
        * Resolves #85628: Error in Spanish localization file
+       * Resolves #85629: Remove dependency on TYPO3 ClientUtility
 
 2018-04-02  Stanislas Rolland  <typo(arobas)sjbr.ca>
        * Resolves #84576: Adapt font maker backend module to TYPO3 CMS 7 & 8
index 789a0c3..64ff112 100644 (file)
@@ -4,7 +4,7 @@ namespace SJBR\SrFreecap\ViewHelpers;
 /***************************************************************
  *  Copyright notice
  *
- *  (c) 2013-2017 Stanislas Rolland <typo3(arobas)sjbr.ca>
+ *  (c) 2013-2018 Stanislas Rolland <typo3(arobas)sjbr.ca>
  *  All rights reserved
  *
  *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -28,7 +28,6 @@ namespace SJBR\SrFreecap\ViewHelpers;
 
 use SJBR\SrFreecap\ViewHelpers\TranslateViewHelper;
 use TYPO3\CMS\Core\Session\Backend\Exception\SessionNotFoundException;
-use TYPO3\CMS\Core\Utility\ClientUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
@@ -79,8 +78,8 @@ class AudioViewHelper extends AbstractTagBasedViewHelper
                $translator = GeneralUtility::makeInstance(TranslateViewHelper::class);
                $translator->injectConfigurationManager($this->configurationManager);
                // Get browser info: in IE 8, we will use a simple link, as dynamic insertion of object element gives unpredictable results
-        $browserInfo = ClientUtility::getBrowserInfo(GeneralUtility::getIndpEnv('HTTP_USER_AGENT'));
-        $browerIsIE8 = $browserInfo['browser'] == 'msie' && $browserInfo['version'] == '8';
+        $browserInfo = GeneralUtility::getIndpEnv('HTTP_USER_AGENT');
+        $browerIsIE8 = strpos($browserInfo, 'MSIE 8') !== false;
                // Generate the icon
                if ($settings['accessibleOutput'] && (int)$GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {
                        $fakeId = GeneralUtility::shortMD5(uniqid (rand()),5);