[BUGFIX] RTE: Insert Tag dialogue may raise security error in Firefox 75/33375/3
authorStanislas Rolland <typo3@sjbr.ca>
Fri, 17 Oct 2014 23:05:32 +0000 (19:05 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 17 Oct 2014 23:23:04 +0000 (01:23 +0200)
Problem: If a style sheet from another domain is imported by the style
sheet configured for the RTE, a security error is raised by Firefox
when opening the Insert tag dialogue window.
Solution: Catch the error and report it on the console.

Releases: master, 6.2
Resolves: #62316
Change-Id: I093416abbc784f7548cda3b6c9be1d4b7d484040
Reviewed-on: http://review.typo3.org/33375
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/quick-tag.js

index c546401..dc31fff 100644 (file)
@@ -232,7 +232,13 @@ HTMLArea.QuickTag = Ext.extend(HTMLArea.Plugin, {
                        } else {
                                        // ImportRule (Mozilla)
                                if (rule.styleSheet) {
-                                       this.parseCssRule(rule.styleSheet.cssRules, valueStore);
+                                       try {
+                                               this.parseCssRule(rule.styleSheet.cssRules, valueStore);
+                                       } catch (e) {
+                                               if (/Security/i.test(e)) {
+                                                       this.appendToLog('parseCssRule', 'A security error occurred. Make sure all stylesheets are accessed from the same domain/subdomain and using the same protocol as the current script.', 'error');
+                                               }
+                                       }
                                }
                                        // MediaRule (Mozilla)
                                if (rule.cssRules) {