Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.160
diff -u -p -r1.160 form.inc
--- includes/form.inc	16 Nov 2006 09:06:59 -0000	1.160
+++ includes/form.inc	25 Nov 2006 00:59:26 -0000
@@ -249,7 +249,12 @@ function drupal_process_form($form_id, &
   // We've finished calling functions that alter the global values, so we can
   // restore the ones that were there before this function was called.
   list($form_values, $form_submitted, $form_button_counter) = array_pop($saved_globals);
-  return $redirect;
+  if (isset($redirect)) {
+    return $redirect;
+  }
+  else {
+    return FALSE;
+  }
 }
 
 /**
@@ -306,7 +311,7 @@ function drupal_prepare_form($form_id, &
       $form['form_token'] = array('#type' => 'token', '#default_value' => drupal_get_token($form['#token']));
     }
   }
-  else if ($user->uid && !$form['#programmed']) {
+  else if (isset($user) && $user->uid && !$form['#programmed']) {
     $form['#token'] = $form_id;
     $form['form_token'] = array(
       '#id' => 'edit-'. str_replace('_', '-', $form_id) .'-form-token',
@@ -442,7 +447,7 @@ function drupal_render_form($form_id, &$
     if (theme_get_function($form_id)) {
       $form['#theme'] = $form_id;
     }
-    elseif (theme_get_function($base)) {
+    elseif (isset($base) && theme_get_function($base)) {
       $form['#theme'] = $base;
     }
   }
@@ -944,7 +949,13 @@ function theme_fieldset($element) {
     }
   }
 
-  return '<fieldset' . drupal_attributes($element['#attributes']) .'>' . ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . ($element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . $element['#children'] . $element['#value'] . "</fieldset>\n";
+  $output = '<fieldset' . drupal_attributes($element['#attributes']) .'>';
+  $output .= (isset($element['#title']) ? '<legend>'. $element['#title'] .'</legend>' : '');
+  $output .= (isset($element['#description']) ? '<div class="description">'. $element['#description'] .'</div>' : '');
+  $output .= $element['#children'];
+  $output .= (isset($element['#value']) ? $element['#value'] : '') . "</fieldset>\n";
+
+  return $output;
 }
 
 /**
