Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.814
diff -u -r1.814 common.inc
--- includes/common.inc	31 Oct 2008 02:23:24 -0000	1.814
+++ includes/common.inc	31 Oct 2008 15:43:35 -0000
@@ -1519,7 +1519,12 @@
   if (is_array($attributes)) {
     $t = '';
     foreach ($attributes as $key => $value) {
-      $t .= " $key=" . '"' . check_plain($value) . '"';
+      if ($key == 'class' && is_array($value)) {
+        $t .= " $key=" . '"' . check_plain(implode(' ', $value)) . '"';
+      }
+      else {
+        $t .= " $key=" . '"' . check_plain($value) . '"';
+      }
     }
     return $t;
   }
