diff --git a/includes/common.inc b/includes/common.inc
index 05af5a7..a21ffc7 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1540,13 +1540,11 @@ function url($path = NULL, $options = array()) {
  *   An HTML string ready for insertion in a tag.
  */
 function drupal_attributes($attributes = array()) {
-  if (is_array($attributes)) {
-    $t = '';
-    foreach ($attributes as $key => $value) {
-      $t .= " $key=".'"'. check_plain($value) .'"';
-    }
-    return $t;
+  $t = '';
+  foreach ((array) $attributes as $attribute => $data) {
+    $t .= " $attribute=".'"'. check_plain($data) .'"';
   }
+  return $t;
 }
 
 /**
