=== modified file 'includes/common.inc'
--- includes/common.inc	2007-03-08 19:33:55 +0000
+++ includes/common.inc	2007-03-25 19:39:50 +0000
@@ -351,6 +351,7 @@ function drupal_not_found() {
 
   if (empty($return)) {
     drupal_set_title(t('Page not found'));
+    $return = '';
   }
   // To conserve CPU and bandwidth, omit the blocks
   print theme('page', $return, FALSE);
@@ -898,6 +899,7 @@ function format_rss_item($title, $link, 
  * with the same format as $array itself for nesting.
  */
 function format_xml_elements($array) {
+  $output = '';
   foreach ($array as $key => $value) {
     if (is_numeric($key)) {
       if ($value['key']) {

=== modified file 'includes/file.inc'
--- includes/file.inc	2007-02-15 11:40:17 +0000
+++ includes/file.inc	2007-03-25 23:43:34 +0000
@@ -382,7 +382,7 @@ function file_copy(&$source, $dest = 0, 
     @chmod($dest, 0664);
   }
 
-  if (is_object($file)) {
+  if (isset($file) && is_object($file)) {
     $file->filename = $basename;
     $file->filepath = $dest;
     $source = $file;

=== modified file 'includes/form.inc'
--- includes/form.inc	2007-03-25 19:57:56 +0000
+++ includes/form.inc	2007-03-26 00:21:05 +0000
@@ -1266,7 +1266,14 @@ function expand_radios($element) {
   if (count($element['#options']) > 0) {
     foreach ($element['#options'] as $key => $choice) {
       if (!isset($element[$key])) {
-        $element[$key] = array('#type' => 'radio', '#title' => $choice, '#return_value' => $key, '#default_value' => $element['#default_value'], '#attributes' => $element['#attributes'], '#parents' => $element['#parents'], '#spawned' => TRUE);
+        $element[$key] = array(
+          '#type' => 'radio',
+          '#title' => $choice,
+          '#return_value' => $key,
+          '#default_value' => isset($element['#default_value']) ? $element['#default_value'] : NULL,
+          '#attributes' => $element['#attributes'],
+          '#parents' => $element['#parents'],
+        );
       }
     }
   }

=== modified file 'includes/menu.inc'
--- includes/menu.inc	2007-03-19 01:13:28 +0000
+++ includes/menu.inc	2007-03-25 16:05:26 +0000
@@ -635,7 +635,8 @@ function menu_rebuild() {
     $item = &$menu[$path];
     $number_parts = $item['_number_parts'];
     if (isset($item['parent'])) {
-      $parent_parts = explode('/', $menu_path_map[$item['parent']], 6);
+      $item['parent'] = $menu_path_map[$item['parent']];
+      $parent_parts = explode('/', $item['parent'], 6);
       $slashes = count($parent_parts) - 1;
     }
     else {
@@ -726,7 +727,7 @@ function menu_rebuild() {
         $item['parent'] = implode('/', array_slice($item['_parts'], 0, $item['_number_parts'] - 1));
       }
       else {
-        $item['_depth'] = $item['parent'] ? $menu[$menu_path_map[$item['parent']]]['_depth'] + 1 : 1;
+        $item['_depth'] = $item['parent'] ? $menu[$item['parent']]['_depth'] + 1 : 1;
       }
     }
     else {

=== modified file 'includes/session.inc'
--- includes/session.inc	2006-12-04 10:41:19 +0000
+++ includes/session.inc	2007-03-25 19:22:39 +0000
@@ -70,11 +70,11 @@ function sess_write($key, $value) {
     // session table rows without breaking throttle module and "Who's Online"
     // block.
     if ($user->uid || $value || count($_COOKIE)) {
-      db_query("INSERT INTO {sessions} (sid, uid, cache, hostname, session, timestamp) VALUES ('%s', %d, %d, '%s', '%s', %d)", $key, $user->uid, $user->cache, $_SERVER["REMOTE_ADDR"], $value, time());
+      db_query("INSERT INTO {sessions} (sid, uid, cache, hostname, session, timestamp) VALUES ('%s', %d, %d, '%s', '%s', %d)", $key, $user->uid, isset($user->cache) ? $user->cache : '', $_SERVER["REMOTE_ADDR"], $value, time());
     }
   }
   else {
-    db_query("UPDATE {sessions} SET uid = %d, cache = %d, hostname = '%s', session = '%s', timestamp = %d WHERE sid = '%s'", $user->uid, $user->cache, $_SERVER["REMOTE_ADDR"], $value, time(), $key);
+    db_query("UPDATE {sessions} SET uid = %d, cache = %d, hostname = '%s', session = '%s', timestamp = %d WHERE sid = '%s'", $user->uid, isset($user->cache) ? $user->cache : '', $_SERVER["REMOTE_ADDR"], $value, time(), $key);
 
     // TODO: this can be an expensive query. Perhaps only execute it every x minutes. Requires investigation into cache expiration.
     if ($user->uid) {

=== modified file 'includes/theme.inc'
--- includes/theme.inc	2007-03-02 09:40:13 +0000
+++ includes/theme.inc	2007-03-25 20:57:02 +0000
@@ -611,7 +611,7 @@ function theme_links($links, $attributes
         // Pass in $link as $options, they share the same keys.
         $output .= l($link['title'], $link['href'], $link);
       }
-      else if ($link['title']) {
+      else if (!empty($link['title'])) {
         // Some links are actually not links, but we wrap these in <span> for adding title and class attributes
         if (empty($link['html'])) {
           $link['title'] = check_plain($link['title']);
@@ -810,6 +810,9 @@ function theme_table($header, $rows, $at
     }
     $output .= " </tr></thead>\n";
   }
+  else {
+    $ts = array();
+  }
 
   // Format the table rows:
   $output .= "<tbody>\n";

=== modified file 'install.php'
--- install.php	2007-03-05 16:15:22 +0000
+++ install.php	2007-03-25 05:15:40 +0000
@@ -547,6 +547,7 @@ function install_missing_modules_error($
  */
 function install_complete($profile) {
   global $base_url;
+  $output = '';
   // Store install profile for later use.
   variable_set('install_profile', $profile);
 

=== modified file 'modules/aggregator/aggregator.module'
--- modules/aggregator/aggregator.module	2007-03-17 18:30:14 +0000
+++ modules/aggregator/aggregator.module	2007-03-26 00:17:08 +0000
@@ -310,7 +310,7 @@ function aggregator_block($op = 'list', 
 /**
  * Generate a form to add/edit/delete aggregator categories.
  */
- function aggregator_form_category($edit = array()) {
+function aggregator_form_category($edit = array('title' => '', 'description' => '', 'cid' => NULL)) {
   $form['title'] = array('#type' => 'textfield',
     '#title' => t('Title'),
     '#default_value' => $edit['title'],
@@ -408,7 +408,7 @@ function aggregator_save_category($edit)
 /**
  * Generate a form to add/edit feed sources.
  */
-function aggregator_form_feed($edit = array()) {
+function aggregator_form_feed($edit = array('refresh' => 900, 'title' => '', 'url' => '', 'fid' => NULL)) {
   $period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval');
 
   if ($edit['refresh'] == '') {

=== modified file 'modules/block/block.module'
--- modules/block/block.module	2007-03-25 21:11:26 +0000
+++ modules/block/block.module	2007-03-26 00:21:04 +0000
@@ -191,6 +191,10 @@ function _block_rehash() {
 
   // Reinsert new set of blocks into table.
   foreach ($blocks as $block) {
+    $block += array(
+      'visibility' => NULL,
+      'throttle' => NULL,
+    );
     db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, visibility, pages, custom, throttle, title) VALUES ('%s', '%s', '%s', %d, %d, '%s', %d, '%s', %d, %d, '%s')", $block['module'], $block['delta'], $theme_key, $block['status'], $block['weight'], $block['region'], $block['visibility'], $block['pages'], $block['custom'], $block['throttle'], $block['title']);
   }
   db_unlock_tables();

=== modified file 'modules/blog/blog.module'
--- modules/blog/blog.module	2007-03-07 12:41:02 +0000
+++ modules/blog/blog.module	2007-03-25 19:33:59 +0000
@@ -133,7 +133,7 @@ function blog_page_user($uid) {
 
   $account = user_load(array((is_numeric($uid) ? 'uid' : 'name') => $uid, 'status' => 1));
 
-  if ($account->uid) {
+  if (!empty($account->uid)) {
     drupal_set_title($title = t("@name's blog", array('@name' => $account->name)));
 
     if (($account->uid == $user->uid) && user_access('edit own blog')) {

=== modified file 'modules/book/book.module'
--- modules/book/book.module	2007-03-25 21:02:33 +0000
+++ modules/book/book.module	2007-03-26 00:21:05 +0000
@@ -196,14 +196,14 @@ function book_submit(&$node) {
  */
 function book_form(&$node) {
   $type = node_get_types('type', $node);
-  if ($node->nid && !$node->parent && !user_access('create new books')) {
+  if (!empty($node->nid) && !$node->parent && !user_access('create new books')) {
     $form['parent'] = array('#type' => 'value', '#value' => $node->parent);
   }
   else {
     $form['parent'] = array('#type' => 'select',
       '#title' => t('Parent'),
-      '#default_value' => ($node->parent ? $node->parent : arg(4)),
-      '#options' => book_toc($node->nid),
+      '#default_value' => (isset($node->parent) ? $node->parent : arg(4)),
+      '#options' => book_toc(isset($node->nid) ? $node->nid : 0),
       '#weight' => -4,
       '#description' => user_access('create new books') ? t('The parent section in which to place this page. Note that each page whose parent is &lt;top-level&gt; is an independent, top-level book.') : t('The parent that this page belongs in.'),
     );
@@ -226,7 +226,7 @@ function book_form(&$node) {
   if (user_access('administer nodes')) {
     $form['weight'] = array('#type' => 'weight',
       '#title' => t('Weight'),
-      '#default_value' => $node->weight,
+      '#default_value' => isset($node->weight) ? $node->weight : 0,
       '#delta' => 15,
       '#weight' => 5,
       '#description' => t('Pages at a given level are ordered first by weight and then by title.'),

=== modified file 'modules/color/color.module'
--- modules/color/color.module	2007-01-20 08:12:20 +0000
+++ modules/color/color.module	2007-03-25 23:34:52 +0000
@@ -145,7 +145,7 @@ function theme_color_scheme_form($form) 
   $info = $form['info']['#value'];
   $path = drupal_get_path('theme', $theme) .'/';
   drupal_add_css($path . $info['preview_css']);
-
+  $output = '';
   // Wrapper
   $output .= '<div class="color-form clear-block">';
 

=== modified file 'modules/comment/comment.module'
--- modules/comment/comment.module	2007-03-12 13:08:02 +0000
+++ modules/comment/comment.module	2007-03-25 19:24:30 +0000
@@ -1538,7 +1538,23 @@ function comment_form($edit, $title = NU
     $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => !empty($edit['subject']) ? $edit['subject'] : '');
   }
 
-  $form['comment_filter']['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => !empty($edit['comment']) ? $edit['comment'] : $user->signature, '#required' => TRUE);
+  if (!empty($edit['comment'])) {
+    $default = $edit['comment'];
+  }
+  elseif (isset($user->signature)) {
+    $default = $user->signature;
+  }
+  else {
+    $default = '';
+  }
+
+  $form['comment_filter']['comment'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Comment'),
+    '#rows' => 15,
+    '#default_value' => $default,
+    '#required' => TRUE,
+  );
   if (!isset($edit['format'])) {
     $edit['format'] = FILTER_FORMAT_DEFAULT;
   }

=== modified file 'modules/contact/contact.module'
--- modules/contact/contact.module	2007-02-15 11:40:17 +0000
+++ modules/contact/contact.module	2007-03-25 23:25:04 +0000
@@ -98,7 +98,15 @@ function contact_menu() {
 
 function _contact_user_tab_access($account) {
   global $user;
-  return $account && (($user->uid != $account->uid && $account->contact) || user_access('administer users'));
+  if (!isset($account->contact)) {
+    $account->contact = FALSE;
+  }
+  return
+    $account &&
+    (
+      ($user->uid != $account->uid && $account->contact) ||
+      user_access('administer users')
+    );
 }
 
 /**
@@ -121,7 +129,7 @@ function contact_user($type, &$edit, &$u
     return $form;
   }
   elseif ($type == 'validate') {
-    return array('contact' => $edit['contact']);
+    return array('contact' => isset($edit['contact']) ? $edit['contact'] : FALSE);
   }
   elseif ($type == 'insert') {
     $edit['contact'] = variable_get('contact_default_status', 1);
@@ -149,6 +157,16 @@ function contact_admin_edit($cid = NULL)
   if (arg(3) == "edit" && $cid > 0) {
     $edit = db_fetch_array(db_query("SELECT * FROM {contact} WHERE cid = %d", $cid));
   }
+  else {
+    $edit = array(
+      'category' => '',
+      'recipients' => '',
+      'reply' => '',
+      'weight' => 0,
+      'selected' => 0,
+      'cid' => NULL,
+    );
+  }
   $form['category'] = array('#type' => 'textfield',
     '#title' => t('Category'),
     '#maxlength' => 255,

=== modified file 'modules/forum/forum.module'
--- modules/forum/forum.module	2007-03-17 18:30:14 +0000
+++ modules/forum/forum.module	2007-03-26 00:14:50 +0000
@@ -210,7 +210,7 @@ function forum_admin_settings() {
 function forum_form_alter($form_id, &$form) {
   // hide critical options from forum vocabulary
   if ($form_id == 'taxonomy_form_vocabulary') {
-    if ($form['vid']['#value'] == _forum_get_vid()) {
+    if (isset($form['vid']) && $form['vid']['#value'] == _forum_get_vid()) {
       $form['help_forum_vocab'] = array(
         '#value' => t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'),
         '#weight' => -1,
@@ -481,7 +481,7 @@ function forum_form_container($edit = ar
 }
 
 function forum_form_main($type, $edit = array()) {
-  if ($_POST['op'] == t('Delete') || $_POST['confirm']) {
+  if ((isset($_POST['op']) && $_POST['op'] == t('Delete')) || !empty($_POST['confirm'])) {
     return drupal_get_form('forum_confirm_delete', $edit['tid']);
   }
   switch ($type) {
@@ -500,6 +500,12 @@ function forum_form_main($type, $edit = 
  * @param $edit Associative array containing a forum term to be added or edited.
  */
 function forum_form_forum($edit = array()) {
+  $edit += array(
+    'name' => '', 
+    'description' => '', 
+    'tid' => NULL, 
+    'weight' => 0,
+  );
   $form['name'] = array('#type' => 'textfield',
     '#title' => t('Forum name'),
     '#default_value' => $edit['name'],

=== modified file 'modules/node/content_types.inc'
--- modules/node/content_types.inc	2007-03-07 13:08:04 +0000
+++ modules/node/content_types.inc	2007-03-25 19:07:31 +0000
@@ -20,24 +20,20 @@ function node_overview_types() {
     if (function_exists($type->module .'_form')) {
       $name = check_plain($name);
       $type_url_str = str_replace('_', '-', $type->type);
-      // Populate the operations field.
-      $operations = array();
-
+      $row = array(
+        l($name, 'admin/content/types/'. $type_url_str),
+        check_plain($type->type),
+        check_plain($type->description),
+      );
       // Set the edit column.
-      $operations[] = array('data' => l(t('edit'), 'admin/content/types/'. $type_url_str));
+      $row[] = array('data' => l(t('edit'), 'admin/content/types/'. $type_url_str));
 
       // Set the delete column.
       if ($type->custom) {
-        $operations[] = array('data' => l(t('delete'), 'admin/content/types/'. $type_url_str .'/delete'));
+        $row[] = array('data' => l(t('delete'), 'admin/content/types/'. $type_url_str .'/delete'));
       }
       else {
-        $operations[] = array('data' => '');
-      }
-
-      $row = array(array('data' => l($name, 'admin/content/types/'. $type_url_str), 'class' => $class), array('data' => check_plain($type->type), 'class' => $class), array('data' => check_plain($type->description), 'class' => $class));
-      foreach ($operations as $operation) {
-        $operation['class'] = $class;
-        $row[] = $operation;
+        $row[] = array('data' => '');
       }
       $rows[] = $row;
     }

=== modified file 'modules/node/node.module'
--- modules/node/node.module	2007-03-17 18:30:14 +0000
+++ modules/node/node.module	2007-03-26 00:11:47 +0000
@@ -290,6 +290,15 @@ function node_type_save($info) {
   $is_existing = FALSE;
   $existing_type = !empty($info->old_type) ? $info->old_type : $info->type;
   $is_existing = db_num_rows(db_query("SELECT * FROM {node_type} WHERE type = '%s'", $existing_type));
+  if (!isset($info->help)) {
+    $info->help = '';
+  }
+  if (!isset($info->min_word_count)) {
+    $info->min_word_count = 0;
+  }
+  if (!isset($info->body_label)) {
+    $info->body_label = '';
+  }
 
   if ($is_existing) {
     db_query("UPDATE {node_type} SET type = '%s', name = '%s', module = '%s', has_title = %d, title_label = '%s', has_body = %d, body_label = '%s', description = '%s', help = '%s', min_word_count = %d, custom = %d, modified = %d, locked = %d WHERE type = '%s'", $info->type, $info->name, $info->module, $info->has_title, $info->title_label, $info->has_body, $info->body_label, $info->description, $info->help, $info->min_word_count, $info->custom, $info->modified, $info->locked, $existing_type);
@@ -1523,6 +1532,7 @@ function node_admin_nodes() {
   $form['options']['submit'] = array('#type' => 'submit', '#value' => t('Update'));
 
   $destination = drupal_get_destination();
+  $nodes = array();
   while ($node = db_fetch_object($result)) {
     $nodes[$node->nid] = '';
     $form['title'][$node->nid] = array('#value' => l($node->title, 'node/'. $node->nid) .' '. theme('mark', node_mark($node->nid, $node->changed)));
@@ -1760,6 +1770,7 @@ function node_feed($nodes = 0, $channel 
   $item_length = variable_get('feed_item_length', 'teaser');
   $namespaces = array('xmlns:dc="http://purl.org/dc/elements/1.1/"');
 
+  $items = '';
   while ($node = db_fetch_object($nodes)) {
     // Load the specified node:
     $item = node_load($node->nid);
@@ -1784,7 +1795,7 @@ function node_feed($nodes = 0, $channel 
     $extra = node_invoke_nodeapi($item, 'rss item');
     $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' =>  date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid .' at '. $base_url, 'attributes' => array('isPermaLink' => 'false'))));
     foreach ($extra as $element) {
-      if ($element['namespace']) {
+      if (isset($element['namespace'])) {
         $namespaces = array_merge($namespaces, $element['namespace']);
       }
     }
@@ -1938,6 +1949,10 @@ function node_form($node, $form_values =
   foreach (array('nid', 'vid', 'uid', 'created', 'type') as $key) {
     $form[$key] = array('#type' => 'value', '#value' => isset($node->$key) ? $node->$key : NULL);
   }
+  if (!isset($node->nid)) {
+    $node->body = NULL;
+    $node->title = NULL;
+  }
 
   // Changed must be sent to the client, for later overwrite error checking.
   $form['changed'] = array('#type' => 'hidden', '#default_value' => isset($node->changed) ? $node->changed : NULL);

=== modified file 'modules/path/path.module'
--- modules/path/path.module	2007-03-17 18:30:14 +0000
+++ modules/path/path.module	2007-03-25 23:44:40 +0000
@@ -182,7 +182,7 @@ function path_set_alias($path = NULL, $a
 /**
  * Return a form for editing or creating an individual URL alias.
  */
-function path_form($edit = '') {
+function path_form($edit = array('src' => '', 'dst' => '', 'pid' => NULL)) {
   $form['#submit']['path_form_submit'] = array();
   $form['#validate']['path_form_validate'] = array();
   $form['#theme'] = 'path_form';

=== modified file 'modules/poll/poll.module'
--- modules/poll/poll.module	2007-02-11 09:30:50 +0000
+++ modules/poll/poll.module	2007-03-25 20:55:41 +0000
@@ -133,7 +133,7 @@ function poll_form($node, $form_values =
     }
   }
   else {
-    $choices = max(2, count($node->choice) ? count($node->choice) : 5);
+    $choices = max(2, empty($node->choice) ? 5: count($node->choice));
   }
 
   $form['choices'] = array(
@@ -166,14 +166,14 @@ function poll_form($node, $form_values =
     $form['choice'][$a]['chtext'] = array(
       '#type' => 'textfield',
       '#title' => t('Choice @n', array('@n' => ($a + 1))),
-      '#default_value' => $node->choice[$a]['chtext'],
+      '#default_value' => isset($node->choice) ? $node->choice[$a]['chtext'] : '',
     );
 
     if ($admin) {
       $form['choice'][$a]['chvotes'] = array(
         '#type' => 'textfield',
         '#title' => t('Votes for choice @n', array('@n' => ($a + 1))),
-        '#default_value' => (int)$node->choice[$a]['chvotes'],
+        '#default_value' => isset($node->choice) ? (int)$node->choice[$a]['chvotes'] : 0,
         '#size' => 5, '#maxlength' => 7
       );
     }
@@ -197,7 +197,7 @@ function poll_form($node, $form_values =
   $form['settings']['runtime'] = array(
     '#type' => 'select',
     '#title' => t('Poll duration'),
-    '#default_value' => $node->runtime,
+    '#default_value' => isset($node->runtime) ? $node->runtime : 0,
     '#options' => $_duration,
     '#description' => t('After this period, the poll will be closed automatically.'),
   );

=== modified file 'modules/search/search.module'
--- modules/search/search.module	2007-03-17 18:30:14 +0000
+++ modules/search/search.module	2007-03-26 00:18:32 +0000
@@ -933,7 +933,7 @@ function search_view($type = 'node') {
     return $output;
   }
 
-  return drupal_get_form('search_form', NULL, $keys, $type);
+  return drupal_get_form('search_form', NULL, empty($keys) ? array() : $keys, $type);
 }
 
 /**

=== modified file 'modules/system/system.module'
--- modules/system/system.module	2007-03-17 18:30:14 +0000
+++ modules/system/system.module	2007-03-25 20:43:11 +0000
@@ -457,6 +457,7 @@ function system_admin_theme_submit($form
  */
 function system_theme_select_form($description = '', $default_value = '', $weight = 0) {
   if (user_access('select different theme')) {
+    $enabled = array();
     foreach (list_themes() as $theme) {
       if ($theme->status) {
         $enabled[] = $theme;
@@ -975,7 +976,7 @@ function system_theme_data() {
   db_query("DELETE FROM {system} WHERE type = 'theme'");
 
   foreach ($themes as $theme) {
-    db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, 'theme', $theme->filename, $theme->status, 0, 0);
+    db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0);
   }
 
   return $themes;
@@ -1034,7 +1035,7 @@ function system_region_list($theme_key) 
  */
 function system_default_region($theme) {
   $regions = array_keys(system_region_list($theme));
-  return $regions[0];
+  return isset($regions[0]) ? $regions[0] : '';
 }
 
 /**
@@ -1142,6 +1143,7 @@ function system_themes() {
   drupal_clear_css_cache();
   $themes = system_theme_data();
   ksort($themes);
+  $status = array();
 
   foreach ($themes as $info) {
     $info->screenshot = dirname($info->filename) .'/screenshot.png';
@@ -1150,10 +1152,10 @@ function system_themes() {
     $form[$info->name]['screenshot'] = array('#value' => $screenshot);
     $form[$info->name]['description'] = array('#type' => 'item', '#title' => $info->name,  '#value' => dirname($info->filename));
     $options[$info->name] = '';
-    if ($info->status) {
+    if (!empty($info->status)) {
       $status[] = $info->name;
     }
-    if ($info->status && (function_exists($info->prefix .'_settings') || function_exists($info->prefix .'_features'))) {
+    if (!empty($info->status) && (function_exists($info->prefix .'_settings') || function_exists($info->prefix .'_features'))) {
       $form[$info->name]['operations'] = array('#value' => l(t('configure'), 'admin/build/themes/settings/'. $info->name) );
     }
     else {
@@ -1325,8 +1327,9 @@ function system_modules($form_values = N
     }
   }
 
+  $modules_required = drupal_required_modules();
   // Merge in required modules.
-  foreach (drupal_required_modules() as $required) {
+  foreach ($modules_required as $required) {
     $disabled[] = $required;
     $form['disabled_modules']['#value'][$required] = TRUE;
   }
@@ -1498,7 +1501,7 @@ function system_modules_submit($form_id,
 
   $current_module_list = module_list(TRUE, FALSE);
 
-  if (is_array($form_values['throttle'])) {
+  if (isset($form_values['throttle'])) {
     foreach ($form_values['throttle'] as $key => $choice) {
       db_query("UPDATE {system} SET throttle = %d WHERE type = 'module' and name = '%s'", $choice ? 1 : 0, $key);
     }
@@ -1853,7 +1856,13 @@ function system_status($check = FALSE) {
  * Helper function to sort requirements.
  */
 function _system_sort_requirements($a, $b) {
-  return (isset($a['weight']) || isset($b['weight'])) ? $a['weight'] - $b['weight'] : strcmp($a['title'], $b['title']);
+  if (!isset($a['weight'])) {
+    if (!isset($b['weight'])) {
+      return strcmp($a['title'], $b['title']);
+    }
+    return -$b['weight'];
+  }
+  return isset($b['weight']) ? $a['weight'] - $b['weight'] : $a['weight'];
 }
 
 /**
@@ -2165,8 +2174,6 @@ function confirm_form($form, $question, 
   $form['actions'] = array('#prefix' => '<div class="container-inline">', '#suffix' => '</div>');
   $form['actions']['submit'] = array('#type' => 'submit', '#value' => $yes ? $yes : t('Confirm'));
   $form['actions']['cancel'] = array('#value' => $cancel);
-  $form['#submit']['confirm_form_submit'] = array();
-  $form['#validate']['confirm_form_validate'] = array();
   $form['#theme'] = 'confirm_form';
   return $form;
 }
@@ -2199,6 +2206,9 @@ function theme_admin_page($blocks) {
         // perform automatic striping.
         $block['position'] = ++$stripe % 2 ? 'left' : 'right';
       }
+      if (!isset($container[$block['position']])) {
+        $container[$block['position']] = '';
+      }
       $container[$block['position']] .= $block_output;
     }
   }

=== modified file 'modules/taxonomy/taxonomy.module'
--- modules/taxonomy/taxonomy.module	2007-03-25 19:06:53 +0000
+++ modules/taxonomy/taxonomy.module	2007-03-25 20:12:12 +0000
@@ -179,7 +179,7 @@ function taxonomy_overview_terms($vocabu
   $header = array(t('Name'), t('Operations'));
 
   drupal_set_title(check_plain($vocabulary->name));
-  $start_from      = $_GET['page'] ? $_GET['page'] : 0;
+  $start_from      = isset($_GET['page']) ? $_GET['page'] : 0;
   $total_entries   = 0;  // total count for pager
   $page_increment  = 25; // number of tids per page
   $displayed_count = 0;  // number of tids shown
@@ -194,7 +194,7 @@ function taxonomy_overview_terms($vocabu
     $displayed_count++; // we're counting tids displayed
   }
 
-  if (!$rows) {
+  if (empty($rows)) {
     $rows[] = array(array('data' => t('No terms available.'), 'colspan' => '2'));
   }
 
@@ -212,6 +212,18 @@ function taxonomy_overview_terms($vocabu
  * Display form for adding and editing vocabularies.
  */
 function taxonomy_form_vocabulary($edit = array()) {
+  $edit += array(
+    'name' => '',
+    'description' => '',
+    'help' => '',
+    'nodes' => array(),
+    'hierarchy' => 0,
+    'relations' => 0,
+    'tags' => 0,
+    'multiple' => 0,
+    'required' => 0,
+    'weight' => 0,
+  );
   $form['name'] = array('#type' => 'textfield',
     '#title' => t('Vocabulary name'),
     '#default_value' => $edit['name'],
@@ -270,7 +282,7 @@ function taxonomy_form_vocabulary($edit 
   );
 
   $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
-  if ($edit['vid']) {
+  if (isset($edit['vid'])) {
     $form['delete'] = array('#type' => 'submit', '#value' => t('Delete'));
     $form['vid'] = array('#type' => 'value', '#value' => $edit['vid']);
     $form['module'] = array('#type' => 'value', '#value' => $edit['module']);
@@ -372,6 +384,12 @@ function taxonomy_vocabulary_confirm_del
 }
 
 function taxonomy_form_term($vocabulary, $edit = array()) {
+  $edit += array(
+    'name' => '',
+    'description' => '',
+    'tid' => NULL,
+    'weight' => 0,
+  );
   $form['name'] = array(
     '#type' => 'textfield',
     '#title' => t('Term name'),
@@ -397,10 +415,10 @@ function taxonomy_form_term($vocabulary,
     $exclude[] = $edit['tid'];
 
     if ($vocabulary->hierarchy == 1) {
-      $form['parent'] = _taxonomy_term_select(t('Parent'), 'parent', $parent, $vocabulary_id, l(t('Parent term'), 'admin/help/taxonomy', array('fragment' => 'parent')) .'.', 0, '<'. t('root') .'>', $exclude);
+      $form['parent'] = _taxonomy_term_select(t('Parent'), 'parent', $parent, $vocabulary->vid, l(t('Parent term'), 'admin/help/taxonomy', array('fragment' => 'parent')) .'.', 0, '<'. t('root') .'>', $exclude);
     }
     elseif ($vocabulary->hierarchy == 2) {
-      $form['parent'] = _taxonomy_term_select(t('Parents'), 'parent', $parent, $vocabulary_id, l(t('Parent terms'), 'admin/help/taxonomy', array('fragment' => 'parent')) .'.', 1, '<'. t('root') .'>', $exclude);
+      $form['parent'] = _taxonomy_term_select(t('Parents'), 'parent', $parent, $vocabulary->vid, l(t('Parent terms'), 'admin/help/taxonomy', array('fragment' => 'parent')) .'.', 1, '<'. t('root') .'>', $exclude);
     }
   }
 
@@ -463,12 +481,12 @@ function taxonomy_form_term_submit($form
  *   Status constant indicating if term was inserted or updated.
  */
 function taxonomy_save_term(&$form_values) {
-  if ($form_values['tid'] && $form_values['name']) {
+  if (!empty($form_values['tid']) && $form_values['name']) {
     db_query("UPDATE {term_data} SET name = '%s', description = '%s', weight = %d WHERE tid = %d", $form_values['name'], $form_values['description'], $form_values['weight'], $form_values['tid']);
     $hook = 'update';
     $status = SAVED_UPDATED;
   }
-  else if ($form_values['tid']) {
+  else if (!empty($form_values['tid'])) {
     return taxonomy_del_term($form_values['tid']);
   }
   else {
@@ -479,7 +497,7 @@ function taxonomy_save_term(&$form_value
   }
 
   db_query('DELETE FROM {term_relation} WHERE tid1 = %d OR tid2 = %d', $form_values['tid'], $form_values['tid']);
-  if ($form_values['relations']) {
+  if (!empty($form_values['relations'])) {
     foreach ($form_values['relations'] as $related_id) {
       if ($related_id != 0) {
         db_query('INSERT INTO {term_relation} (tid1, tid2) VALUES (%d, %d)', $form_values['tid'], $related_id);
@@ -760,9 +778,9 @@ function taxonomy_node_get_terms($node, 
  * Make sure incoming vids are free tagging enabled.
  */
 function taxonomy_node_validate(&$node) {
-  if ($node->taxonomy) {
+  if (!empty($node->taxonomy)) {
     $terms = $node->taxonomy;
-    if ($terms['tags']) {
+    if (!empty($terms['tags'])) {
       foreach ($terms['tags'] as $vid => $vid_value) {
         $vocabulary = taxonomy_vocabulary_load($vid);
         if (empty($vocabulary->tags)) {
@@ -1279,11 +1297,15 @@ function taxonomy_nodeapi($node, $op, $a
      return $output;
 
     case 'insert':
-      taxonomy_node_save($node, $node->taxonomy);
+      if (!empty($node->taxonomy)) {
+        taxonomy_node_save($node, $node->taxonomy);
+      }
       break;
 
     case 'update':
-      taxonomy_node_save($node, $node->taxonomy);
+      if (!empty($node->taxonomy)) {
+        taxonomy_node_save($node, $node->taxonomy);
+      }
       break;
 
     case 'delete':

=== modified file 'modules/upload/upload.module'
--- modules/upload/upload.module	2007-03-06 16:43:10 +0000
+++ modules/upload/upload.module	2007-03-26 00:19:45 +0000
@@ -673,7 +673,7 @@ function upload_unmunge_filename($filena
 }
 
 function upload_save(&$node) {
-  if (!is_array($node->files)) {
+  if (empty($node->files) || !is_array($node->files)) {
     return;
   }
 
@@ -774,11 +774,11 @@ function _upload_form($node) {
       $form['files'][$key]['description'] = array('#type' => 'textfield', '#default_value' => (strlen($file->description)) ? $file->description : $file->filename, '#maxlength' => 256, '#description' => $description );
 
       $form['files'][$key]['size'] = array('#value' => format_size($file->filesize));
-      $form['files'][$key]['remove'] = array('#type' => 'checkbox', '#default_value' => $file->remove);
+      $form['files'][$key]['remove'] = array('#type' => 'checkbox', '#default_value' => !empty($file->remove));
       $form['files'][$key]['list'] = array('#type' => 'checkbox',  '#default_value' => $file->list);
       // if the file was uploaded this page request, set value. this fixes the problem
       // formapi has recognizing new checkboxes. see comments in _upload_prepare.
-      if ($_SESSION['file_current_upload'] == $file->fid) {
+      if (isset(_SESSION['file_current_upload']) && $_SESSION['file_current_upload'] == $file->fid) {
         $form['files'][$key]['list']['#value'] = variable_get('upload_list_default',1);
       }
       $form['files'][$key]['filename'] = array('#type' => 'value',  '#value' => $file->filename);

=== modified file 'modules/user/user.module'
--- modules/user/user.module	2007-03-24 05:36:30 +0000
+++ modules/user/user.module	2007-03-25 23:28:26 +0000
@@ -111,7 +111,7 @@ function user_load($array = array()) {
 function user_save($account, $array = array(), $category = 'account') {
   // Dynamically compose a SQL query:
   $user_fields = user_fields();
-  if ($account->uid) {
+  if (is_object($account) && $account->uid) {
     user_module_invoke('update', $array, $account, $category);
     $query = '';
     $data = unserialize(db_result(db_query('SELECT data FROM {users} WHERE uid = %d', $account->uid)));
@@ -1281,12 +1281,11 @@ function user_register() {
 
   // Remove form_group around default fields if there are no other groups.
   if (!$extra) {
-    $form['name'] = $form['account']['name'];
-    $form['mail'] = $form['account']['mail'];
-    $form['pass'] = $form['account']['pass'];
-    $form['status'] = $form['account']['status'];
-    $form['roles'] = $form['account']['roles'];
-    $form['notify'] = $form['account']['notify'];
+    foreach (array('name', 'mail', 'pass', 'status', 'roles', 'notify') as $key) {
+      if (isset($form['account'][$key])) {
+        $form[$key] = $form['account'][$key];
+      }
+    }
     unset($form['account']);
   }
   else {
@@ -1313,11 +1312,14 @@ function user_register_submit($form_id, 
   else {
     $pass = user_password();
   };
-  $notify = $form_values['notify'];
+  $notify = isset($form_values['notify']) ? $form_values['notify'] : NULL;
   $from = variable_get('site_mail', ini_get('sendmail_from'));
   if (isset($form_values['roles'])) {
     $roles = array_filter($form_values['roles']);     // Remove unset roles
   }
+  else {
+    $roles = array();
+  }
 
   if (!$admin && array_intersect(array_keys($form_values), array('uid', 'roles', 'init', 'session', 'status'))) {
     watchdog('security', t('Detected malicious attempt to alter protected user fields.'), WATCHDOG_WARNING);
@@ -1428,7 +1430,8 @@ function user_edit_form($uid, $edit, $re
     $roles = user_roles(1);
     unset($roles[DRUPAL_AUTHENTICATED_RID]);
     if ($roles) {
-      $form['account']['roles'] = array('#type' => 'checkboxes', '#title' => t('Roles'), '#default_value' => array_keys((array)$edit['roles']), '#options' => $roles, '#description' => t('The user receives the combined permissions of the %au role, and all roles selected here.', array('%au' => t('authenticated user'))));
+      $default = empty($edit['roles']) ? array() : array_keys($edit['roles']);
+      $form['account']['roles'] = array('#type' => 'checkboxes', '#title' => t('Roles'), '#default_value' => $default, '#options' => $roles, '#description' => t('The user receives the combined permissions of the %au role, and all roles selected here.', array('%au' => t('authenticated user'))));
     }
   }
 
@@ -2029,7 +2032,6 @@ function user_admin_role() {
     );
     $form['#submit']['user_admin_role_submit'] = array();
     $form['#validate']['user_admin_role_validate'] = array();
-    $form['#theme'] = 'user_admin_role';
   }
   return $form;
 }
@@ -2701,7 +2703,7 @@ function theme_user_filters($form) {
     }
   }
 
-  $output .= '<li><dl class="multiselect">'. (sizeof($form['current']) ? '<dt><em>'. t('and') .'</em> '. t('where') .'</dt>' : '') .'<dd class="a">';
+  $output .= '<li><dl class="multiselect">'. (!empty($form['current']) ? '<dt><em>'. t('and') .'</em> '. t('where') .'</dt>' : '') .'<dd class="a">';
   foreach (element_children($form['filter']) as $key) {
     $output .= drupal_render($form['filter'][$key]);
   }

=== modified file 'profiles/default/default.profile'
--- profiles/default/default.profile	2007-03-25 20:49:06 +0000
+++ profiles/default/default.profile	2007-03-26 00:21:05 +0000
@@ -44,6 +44,8 @@ function default_profile_final() {
       'custom' => TRUE,
       'modified' => TRUE,
       'locked' => FALSE,
+      'help' => '',
+      'min_word_count' => '',
     ),
     array(
       'type' => 'story',
@@ -53,6 +55,8 @@ function default_profile_final() {
       'custom' => TRUE,
       'modified' => TRUE,
       'locked' => FALSE,
+      'help' => '',
+      'min_word_count' => '',
     ),
   );
 

=== modified file 'themes/engines/phptemplate/phptemplate.engine'
--- themes/engines/phptemplate/phptemplate.engine	2007-03-25 19:18:12 +0000
+++ themes/engines/phptemplate/phptemplate.engine	2007-03-25 20:10:04 +0000
@@ -202,15 +202,15 @@ function phptemplate_page($content, $sho
     'head_title'          => implode(' | ', $head_title),
     'help'                => theme('help'),
     'language'            => $GLOBALS['locale'],
-    'layout'              => $layout,
+    'layout'              => isset($layout) ? $layout : NULL,
     'logo'                => theme_get_setting('logo'),
     'messages'            => theme('status_messages'),
     'mission'             => isset($mission) ? $mission : '',
     'primary_links'       => menu_primary_links(),
     'search_box'          => (theme_get_setting('toggle_search') ? drupal_get_form('search_theme_form') : ''),
     'secondary_links'     => menu_secondary_links(),
-    'sidebar_left'        => $sidebar_left,
-    'sidebar_right'       => $sidebar_right,
+    'sidebar_left'        => !empty($sidebar_left) ? $sidebar_left : '',
+    'sidebar_right'       => !empty($sidebar_right) ? $sidebar_right : '',
     'site_name'           => (theme_get_setting('toggle_name') ? variable_get('site_name', 'Drupal') : ''),
     'site_slogan'         => (theme_get_setting('toggle_slogan') ? variable_get('site_slogan', '') : ''),
     'css'                 => drupal_add_css(),
@@ -261,9 +261,18 @@ function phptemplate_node($node, $teaser
   else {
     $taxonomy = array();
   }
+  if ($teaser && $node->teaser) {
+    $content = $node->teaser;
+  }
+  elseif (isset($node->body)) {
+    $content = $node->body;
+  }
+  else {
+    $content = '';
+  }
 
   $variables = array(
-    'content'        => ($teaser && $node->teaser) ? $node->teaser : $node->body,
+    'content'        => $content,
     'date'           => format_date($node->created),
     'links'          => $node->links ? theme('links', $node->links, array('class' => 'links inline')) : '',
     'name'           => theme('username', $node),

