[BUGFIX] RTE: Importing google webfonts breaks style sheet parsing
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 5 Jul 2012 16:37:07 +0000 (12:37 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 6 Jul 2012 21:23:45 +0000 (23:23 +0200)
Problem: The imported css file does not contain any css rule.
Solution: Check for the presence of css rules in the imported file.
Note: Thanks to Robert Volk.

Change-Id: I735bafba8a16a958746cba126c450cc97f6ad569
Releases: 4.5, 4.6, 4.7, 6.0
Resolves: #36316
Reviewed-on: http://review.typo3.org/12681
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js

index 6a46c4a..89f5fd5 100644 (file)
@@ -3775,7 +3775,7 @@ HTMLArea.CSS.Parser = Ext.extend(Ext.util.Observable, {
                                this.parseSelectorText(cssRules[rule].selectorText);
                        } else {
                                        // Import rule
-                               if (cssRules[rule].styleSheet) {
+                               if (cssRules[rule].styleSheet && cssRules[rule].styleSheet.cssRules) {
                                        this.parseRules(cssRules[rule].styleSheet.cssRules);
                                }
                                        // Media rule