[BUGFIX] Escape value in FormEngine.removeOption selector 72/53572/2
authorSusanne Moog <susanne.moog@typo3.com>
Mon, 24 Jul 2017 07:13:53 +0000 (09:13 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Mon, 24 Jul 2017 08:14:48 +0000 (10:14 +0200)
Change-Id: I3373078a78cc65cd27fcff7d38ded5291cdc5f3b
Resolves: #81806
Releases: master, 8.7, 7.6
Reviewed-on: https://review.typo3.org/53572
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js

index 2d8fc9a..6d1a643 100644 (file)
@@ -565,8 +565,9 @@ define(['jquery',
                var $selected = $fieldEl.find(':selected');
 
                $selected.each(function() {
+                       var $value = $(this).attr('value').replace(/([ #;?%&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
                        $availableFieldEl
-                               .find('option[value="' + $(this).attr('value') + '"]')
+                               .find('option[value="' + $value + '"]')
                                .removeClass('hidden')
                                .prop('disabled', false);
                });