[BUGFIX] RTE fails to load in IE 11 with "Access denied" 94/36094/3
authorStanislas Rolland <typo3@sjbr.ca>
Sun, 18 Jan 2015 14:10:46 +0000 (09:10 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Sun, 18 Jan 2015 16:44:09 +0000 (17:44 +0100)
Fix identification of IE 11 as Internet Explorer by RTE.

Note: ExtJS 3.4 will still not recognize IE 11 as Internet Explorer.

Releases: master
Resolves: #55775
Change-Id: Ib2a52159f4c7ec92a3eb9a33203292be64632b13
Reviewed-on: http://review.typo3.org/36094
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Classes/Hook/Frontend/Controller/TypoScriptFrontendControllerHook.php [deleted file]
typo3/sysext/rtehtmlarea/Configuration/Hook/Frontend/Controller/ext_localconf.php [deleted file]
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/UserAgent/UserAgent.js
typo3/sysext/rtehtmlarea/ext_localconf.php

diff --git a/typo3/sysext/rtehtmlarea/Classes/Hook/Frontend/Controller/TypoScriptFrontendControllerHook.php b/typo3/sysext/rtehtmlarea/Classes/Hook/Frontend/Controller/TypoScriptFrontendControllerHook.php
deleted file mode 100644 (file)
index ec45a34..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-namespace TYPO3\CMS\Rtehtmlarea\Hook\Frontend\Controller;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Frontend hook to add meta tag when rtehtmlarea is present and user agent is IE 11+
- *
- */
-class TypoScriptFrontendControllerHook {
-
-       /**
-        * Add meta tag when rtehtmlarea is present and user agent is IE 11+
-        *
-        * @param array $params
-        * @param \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $controller
-        * @return void
-        */
-       public function contentPostProcOutput(array $params, \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $controller) {
-               if (strpos($controller->content, 'textarea id="RTEarea') !== FALSE) {
-                       $userAgent = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_USER_AGENT');
-                       $browserInfo = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgent);
-                       if ($browserInfo['browser'] === 'msie' && $browserInfo['version'] > 10) {
-                               $controller->content = preg_replace('/<head([^>]*)>/', '<head$1>' . LF . '<meta http-equiv="X-UA-Compatible" content="IE=10" />', $controller->content);
-                       }
-               }
-       }
-
-}
diff --git a/typo3/sysext/rtehtmlarea/Configuration/Hook/Frontend/Controller/ext_localconf.php b/typo3/sysext/rtehtmlarea/Configuration/Hook/Frontend/Controller/ext_localconf.php
deleted file mode 100644 (file)
index 3d895aa..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-defined('TYPO3_MODE') or die();
-
-if (TYPO3_MODE === 'FE') {
-       // Register frontend hook to add meta tag when rtehtmlarea is present and user agent is IE 11+
-       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output']['rtehtmlarea'] = \TYPO3\CMS\Rtehtmlarea\Hook\Frontend\Controller\TypoScriptFrontendControllerHook::class . '->contentPostProcOutput';
-}
index 1d80acf..cc51961 100644 (file)
@@ -21,11 +21,11 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/UserAgent/UserAgent', [], function () {
                isOpera = /opera/i.test(userAgent),
                isChrome = /\bchrome\b/i.test(userAgent),
                isWebKit = /webkit/i.test(userAgent),
-               isIE = !isOpera && /msie/i.test(userAgent),
+               isIE = (!isOpera && /msie/i.test(userAgent)) || /trident/i.test(userAgent),
                isIE6 = isIE && /msie 6/i.test(userAgent),
                isIE7 = isIE && (/msie 7/i.test(userAgent) || documentMode == 7),
                isIE8 = isIE && ((/msie 8/i.test(userAgent) && documentMode != 7) || documentMode == 8),
-               isGecko = !isWebKit && /gecko/i.test(userAgent),
+               isGecko = !isWebKit && !isIE && /gecko/i.test(userAgent),
                isiPhone = /iphone/i.test(userAgent),
                isiPad = /ipad/i.test(userAgent);
        return {
index 8a0091b..0fe04a1 100644 (file)
@@ -35,8 +35,6 @@ if (strstr($_EXTCONF['defaultConfiguration'], 'Minimal')) {
 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/Hook/SoftReferences/ext_localconf.php';
 // Add Status Report about Conflicting Extensions
 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/Hook/StatusReport/ext_localconf.php';
-// Add frontend hook to add meta tag when rtehtmlarea is present and user agent is IE 11+
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/Hook/Frontend/Controller/ext_localconf.php';
 
 // Set warning in the Update Wizard of the Install Tool for deprecated Page TS Config properties
 $TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['checkForDeprecatedRtePageTSConfigProperties'] = \TYPO3\CMS\Rtehtmlarea\Hook\Install\DeprecatedRteProperties::class;