If there are leading, trailing or double spaces, they will considered as class because of explode(' ', ' class-2 class-6'). Spaces should be trimmed and stripped or empty classes just ignored.

#1 menu_attributes-no-empty-class-1761804-1.patch1019 bytesosopolar
PASSED: [[SimpleTest]]: [MySQL] 108 pass(es). View


osopolar’s picture

1019 bytes
PASSED: [[SimpleTest]]: [MySQL] 108 pass(es). View
osopolar’s picture

Status: Active » Needs review
quicksketch’s picture

A simpler way of handling this problem is wrapping the explode() call in array_filter():

$classes = array_filter(explode(' ', $item['options']['attributes']['class']));
amateescu’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev
Status: Needs review » Fixed

Committed a fix to 7.x-1.x. Thanks for catching this :)


Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.