[BUGFIX] RTE: formattext configuration may raise JavaScript error 35/37935/2
authorStanislas Rolland <typo3@sjbr.ca>
Wed, 18 Mar 2015 21:17:39 +0000 (17:17 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Wed, 18 Mar 2015 21:19:06 +0000 (22:19 +0100)
Check if any option is configured.

Releases: master
Resolves: #65830
Change-Id: I3e41d630cdbcee4eabfad81fa955ad3cb148a073
Reviewed-on: http://review.typo3.org/37935
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/InlineElements.js

index 74260e5..fa702bc 100644 (file)
@@ -62,7 +62,7 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/InlineElements',
                         */
                        var buttonId = 'FormatText';
                        // Wrap the options text in the corresponding inline element
-                       var options = this.buttonsConfiguration[buttonId.toLowerCase()] ? this.buttonsConfiguration[buttonId.toLowerCase()].options : [];
+                       var options = this.buttonsConfiguration[buttonId.toLowerCase()] && this.buttonsConfiguration[buttonId.toLowerCase()].options ? this.buttonsConfiguration[buttonId.toLowerCase()].options : [];
                        for (var i = 0, n = options.length; i < n; i++) {
                                options[i][0] = '<' + options[i][1] + '>' + options[i][0] + '</' + options[i][1] + '>';
                        }