Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1211
diff -u -p -r1.1211 common.inc
--- includes/common.inc	27 Aug 2010 11:54:32 -0000	1.1211
+++ includes/common.inc	31 Aug 2010 16:28:40 -0000
@@ -5793,7 +5793,7 @@ function drupal_common_theme() {
       'variables' => array('type' => MARK_NEW),
     ),
     'item_list' => array(
-      'variables' => array('items' => array(), 'title' => NULL, 'type' => 'ul', 'attributes' => array()),
+      'variables' => array('items' => array(), 'title' => '', 'type' => 'ul', 'attributes' => array()),
     ),
     'more_help_link' => array(
       'variables' => array('url' => NULL),
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.606
diff -u -p -r1.606 theme.inc
--- includes/theme.inc	22 Aug 2010 12:46:21 -0000	1.606
+++ includes/theme.inc	31 Aug 2010 17:59:56 -0000
@@ -1793,12 +1793,12 @@ function theme_mark($variables) {
  *
  * @param $variables
  *   An associative array containing:
- *   - items: An array of items to be displayed in the list. If an item is a
- *     string, then it is used as is. If an item is an array, then the "data"
- *     element of the array is used as the contents of the list item. If an item
- *     is an array with a "children" element, those children are displayed in a
- *     nested list. All other elements are treated as attributes of the list
- *     item element.
+ *   - items: An list of items to render. String values are rendered as is. An
+ *     item can also be an associative array using the following properties:
+ *     - data: The string content of the list item.
+ *     - children: A list of nested child items to render.
+ *     - ...: All other key/value pairs are used as HTML attributes for the list
+ *       item and derived to nested child items, if any.
  *   - title: The title of the list.
  *   - type: The type of list to return (e.g. "ul", "ol").
  *   - attributes: The attributes applied to the list element.
@@ -1807,50 +1807,55 @@ function theme_item_list($variables) {
   $items = $variables['items'];
   $title = $variables['title'];
   $type = $variables['type'];
-  $attributes = $variables['attributes'];
+  $list_attributes = $variables['attributes'];
 
   $output = '<div class="item-list">';
-  if (isset($title)) {
+  if ($title !== '') {
     $output .= '<h3>' . $title . '</h3>';
   }
 
-  if (!empty($items)) {
-    $output .= "<$type" . drupal_attributes($attributes) . '>';
+  if ($items) {
+    $output .= '<' . $type . drupal_attributes($list_attributes) . '>';
+
     $num_items = count($items);
-    foreach ($items as $i => $item) {
+    $i = 0;
+    foreach ($items as $item) {
+      $i++;
       $attributes = array();
-      $children = array();
+
       if (is_array($item)) {
-        foreach ($item as $key => $value) {
-          if ($key == 'data') {
-            $data = $value;
-          }
-          elseif ($key == 'children') {
-            $children = $value;
-          }
-          else {
-            $attributes[$key] = $value;
-          }
+        $value = '';
+        if (isset($item['data'])) {
+          $value .= $item['data'];
+        }
+        $attributes = array_diff_key($item, array('data', 'children'));
+        // Append nested child list, if any.
+        if (isset($item['children'])) {
+          $value .= theme('item_list', array(
+            'items' => $item['children'],
+            'type' => $type,
+            'attributes' => $attributes,
+          ));
         }
       }
       else {
-        $data = $item;
-      }
-      if (count($children) > 0) {
-        // Render nested list.
-        $data .= theme_item_list(array('items' => $children, 'title' => NULL, 'type' => $type, 'attributes' => $attributes));
+        $value = $item;
       }
-      if ($i == 0) {
+
+      $attributes['class'][] = ($i % 2 ? 'odd' : 'even');
+      if ($i == 1) {
         $attributes['class'][] = 'first';
       }
-      if ($i == $num_items - 1) {
+      if ($i == $num_items) {
         $attributes['class'][] = 'last';
       }
-      $output .= '<li' . drupal_attributes($attributes) . '>' . $data . "</li>\n";
+
+      $output .= '<li' . drupal_attributes($attributes) . '>' . $value . '</li>';
     }
     $output .= "</$type>";
   }
   $output .= '</div>';
+
   return $output;
 }
 
