[BUGFIX] RTE: Quick Tag plugin may raise JS exception in Google Chrome 04/35204/2
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 9 Dec 2014 20:05:18 +0000 (15:05 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 9 Dec 2014 20:08:18 +0000 (21:08 +0100)
A JavaScript exception may be raised in Google Chrome on attempt to
access a style sheet on a different domain.

Releases: master
Resolves: #63716
Change-Id: I16b5eb5630e0d4855023bb3ec7e5344574460cad
Reviewed-on: http://review.typo3.org/35204
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/CSS/Parser.js
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/QuickTag.js

index e75e3dc..2957e18 100644 (file)
@@ -227,7 +227,7 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/CSS/Parser',
                                // Import rule
                                try {
                                        if (cssRules[rule].styleSheet && cssRules[rule].styleSheet.cssRules) {
-                                                       this.parseRules(cssRules[rule].styleSheet.cssRules);
+                                               this.parseRules(cssRules[rule].styleSheet.cssRules);
                                        }
                                } catch (e) {
                                        if (/Security/i.test(e)) {
index d88b6e1..2f4462f 100644 (file)
@@ -243,10 +243,12 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/QuickTag',
                                                }));
                                        }
                                } else {
-                                               // ImportRule (Mozilla)
+                                       // ImportRule (Mozilla)
                                        if (rule.styleSheet) {
                                                try {
-                                                       this.parseCssRule(rule.styleSheet.cssRules, valueStore);
+                                                       if (rule.styleSheet.cssRules) {
+                                                               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');
@@ -255,11 +257,11 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/QuickTag',
                                                        }
                                                }
                                        }
-                                               // MediaRule (Mozilla)
+                                       // MediaRule (Mozilla)
                                        if (rule.cssRules) {
                                                this.parseCssRule(rule.cssRules, valueStore);
                                        }
-                                               // IE imports
+                                       // IE imports
                                        if (rule.imports) {
                                                this.parseCssRule(rule.imports, valueStore);
                                        }