diff --git a/core/lib/Drupal/Core/Template/Attribute.php b/core/lib/Drupal/Core/Template/Attribute.php index abd889a..d64824d 100644 --- a/core/lib/Drupal/Core/Template/Attribute.php +++ b/core/lib/Drupal/Core/Template/Attribute.php @@ -143,9 +143,10 @@ public function addClass() { // Merge the values passed in from the classes array. // The argument is cast to an array to support comma separated single // values or one or more array arguments. - // We also filter out any empty values from the array. - $classes = array_filter(array_merge($classes, (array) $arg)); + $classes = array_merge($classes, (array) $arg); } + // Filter out any empty values from the array. + $classes = array_filter($classes); // If there are no classes to add, return early. if (empty($classes)) { return $this;