[BUGFIX] Unset default link if set with values from other link handler 68/47168/7
authorTim Jungebluth <tim.jungebluth@gmail.com>
Wed, 9 Mar 2016 20:21:03 +0000 (21:21 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 10 Mar 2016 15:34:50 +0000 (16:34 +0100)
Change-Id: I49a19d9ca4e08cea927f5541accfade09320210d
Resolves: #74586
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/47168
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/rtehtmlarea/Classes/Controller/BrowseLinksController.php

index ac3166a..12df3c3 100644 (file)
@@ -292,6 +292,12 @@ class BrowseLinksController extends AbstractLinkBrowserController
                     }
                 }
             }
+            if (isset($this->linkAttributeValues['class'])
+                && isset($classesAnchor[$this->displayedLinkHandlerId])
+                && !in_array($this->linkAttributeValues['class'], $classesAnchor[$this->displayedLinkHandlerId], true)
+            ) {
+                unset($this->linkAttributeValues['class']);
+            }
             // Constructing the class selector options
             foreach ($classesAnchorArray as $class) {
                 if (!in_array($class, $classesAnchor['all']) || in_array($class, $classesAnchor['all']) && is_array($classesAnchor[$this->displayedLinkHandlerId]) && in_array($class, $classesAnchor[$this->displayedLinkHandlerId])) {