Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.489
diff -u -p -r1.489 theme.inc
--- includes/theme.inc	22 May 2009 11:34:05 -0000	1.489
+++ includes/theme.inc	24 May 2009 06:10:50 -0000
@@ -631,6 +631,8 @@ function list_themes($refresh = FALSE) {
  *   An HTML string that generates the themed output.
  */
 function theme() {
+  static $default_args;
+
   $args = func_get_args();
   $hook = array_shift($args);
 
@@ -670,7 +672,12 @@ function theme() {
   if (isset($info['function'])) {
     // The theme call is a function.
     if (drupal_function_exists($info['function'])) {
-      $output = call_user_func_array($info['function'], $args);
+      $function = $info['function'];
+      if (!isset($default_args)) {
+        $default_args = array_fill(0, 10, NULL);
+      }
+      $args += $default_args;
+      $output = $function($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9]);
     }
   }
   else {
