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.

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

Comments

StatusFileSize
new1019 bytes
PASSED: [[SimpleTest]]: [MySQL] 108 pass(es).
[ View ]

Status:Active» Needs review

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

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

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 :)

http://drupalcode.org/project/menu_attributes.git/commitdiff/38cb713

Status:Fixed» Closed (fixed)

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