--- ../../drupal/includes/theme.inc	2006-07-13 15:11:36.000000000 +0200
+++ theme.inc	2006-08-02 18:40:42.000000000 +0200
@@ -533,6 +533,14 @@
 
   if (is_array($links)) {
     foreach ($links as $key => $link) {
+      if (!is_array($link['attributes'])) { // no attributes array
+        foreach ($link as $key => $value) {
+          if ($key != 'title'&&$key != 'href')  { // skip title and href
+            $link['attributes'][$key] = $value;   // build attributes array
+          }
+        }
+      }
+
       // Automatically add a class to each link and convert all _ to - for XHTML compliance
       if (isset($link['attributes']) && isset($link['attributes']['class'])) {
         $link['attributes']['class'] .= ' '. str_replace('_', '-', $key);
@@ -541,6 +549,8 @@
         $link['attributes']['class'] = str_replace('_', '-', $key);
       }
 
+
+
       if ($link['href']) {
         $output[] = l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment']);
       }
@@ -766,7 +776,12 @@
       $i = 0;
       foreach ($cells as $cell) {
         $cell = tablesort_cell($cell, $header, $ts, $i++);
-        $output .= _theme_table_cell($cell, 0);
+        $isheader = 0; // default cell not a th
+        if (isset($cell['header'])&&$cell['header']===true) { // only boolean true will succeed
+          $isheader = 1;        	
+          unset($cell['header']); // remove header to not end up in attributes
+        }
+        $output .= _theme_table_cell($cell, $isheader);
       }
       $output .= " </tr>\n";
     }
