[BUGFIX] Classes available in the Insert/Modify image dialogue 17/37917/3
authorStanislas Rolland <typo3@sjbr.ca>
Wed, 18 Mar 2015 02:23:05 +0000 (22:23 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Wed, 18 Mar 2015 14:32:33 +0000 (15:32 +0100)
Problem: If classes are configured for images, the current image
tab raises a JavaScript error.
Solution: Method parameter quotes should be escaped.

Releases: master
Resolves: #65330
Change-Id: I6b2a6dc7ec9154adf857e6c6286c419a00a02289
Reviewed-on: http://review.typo3.org/37917
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Classes/SelectImage.php

index 8b32454..42abb84 100644 (file)
@@ -362,6 +362,7 @@ class SelectImage extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                                                $removedProperties = GeneralUtility::trimExplode(',', $this->buttonConfig['properties.']['removeItems'], TRUE);
                                        }
                                }
+                               $classesImageJSOptions = '';
                                if ($this->buttonConfig['properties.']['class.']['allowedClasses']) {
                                        $classesImageArray = GeneralUtility::trimExplode(',', $this->buttonConfig['properties.']['class.']['allowedClasses'], TRUE);
                                        $classesImageJSOptions = '<option value=""></option>';
@@ -389,8 +390,8 @@ class SelectImage extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                                                SelectImage.RTEtsConfigParams = "' . rawurlencode($this->RTEtsConfigParams) . '";
                                                SelectImage.bparams = "' . $this->bparams . '";
                                                SelectImage.classesImage =  ' . $classesImage . ';
-                                               SelectImage.labels = ' . json_encode($localizedLabels) . '
-                                               SelectImage.Form.build("' . $classesImageJSOptions . '", ' . json_encode($removedProperties) . ', ' . $lockPlainWidth . ', ' . $lockPlainHeight . ');
+                                               SelectImage.labels = ' . json_encode($localizedLabels) . ';
+                                               SelectImage.Form.build(' . GeneralUtility::quoteJSvalue($classesImageJSOptions) . ', ' . json_encode($removedProperties) . ', ' . $lockPlainWidth . ', ' . $lockPlainHeight . ');
                                                SelectImage.Form.insertImageProperties();
                                        });';
                                $this->content .= '<br />' . $this->doc->wrapScriptTags($JScode);