[BUGFIX] Avoid duplicated classes in typolink VH
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / Link / TypolinkViewHelper.php
index af52d0b..0f43862 100644 (file)
@@ -155,10 +155,8 @@ class TypolinkViewHelper extends AbstractViewHelper implements CompilableInterfa
 
         // Combine classes if given in both "parameter" string and "class" argument
         if ($class) {
-            if ($typolinkConfiguration['class']) {
-                $typolinkConfiguration['class'] .= ' ';
-            }
-            $typolinkConfiguration['class'] .= $class;
+            $classes = explode(' ', trim($typolinkConfiguration['class']) . ' ' . trim($class));
+            $typolinkConfiguration['class'] = implode(' ', array_unique(array_filter($classes)));
         }
 
         // Override title if given in title argument