Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.112.2.8
diff -u -p -r1.112.2.8 form.inc
--- includes/form.inc	23 May 2006 18:00:33 -0000	1.112.2.8
+++ includes/form.inc	27 May 2006 09:52:29 -0000
@@ -378,7 +378,7 @@ function form_builder($form_id, $form) {
           $function($form);
         }
         else {
-          $form['#value'] = $form['#default_value'];
+          $form['#value'] = isset($form['#default_value']) ? $form['#default_value'] : NULL;
         }
       }
     }
@@ -393,7 +393,7 @@ function form_builder($form_id, $form) {
   }
 
   // Allow for elements to expand to multiple elements, e.g. radios, checkboxes and files.
-  if (isset($form['#process']) && !$form['#processed']) {
+  if (isset($form['#process']) && !isset($form['#processed'])) {
     foreach ($form['#process'] as $process => $args) {
       if (function_exists($process)) {
         $args = array_merge(array($form), $args);
@@ -503,11 +503,11 @@ function form_render(&$elements) {
   if (!isset($elements['#children'])) {
     $children = element_children($elements);
     /* Render all the children that use a theme function */
-    if (isset($elements['#theme']) && !$elements['#theme_used']) {
+    if (isset($elements['#theme']) && !isset($elements['#theme_used'])) {
       $elements['#theme_used'] = TRUE;
 
-      $previous_value = $elements['#value'];
-      $previous_type = $elements['#type'];
+      $previous_value = isset($elements['#value']) ? $elements['#value'] : NULL;
+      $previous_type = isset($elements['#type']) ? $elements['#type'] : NULL;
       // If we rendered a single element, then we will skip the renderer.
       if (empty($children)) {
         $elements['#printed'] = TRUE;
@@ -536,7 +536,7 @@ function form_render(&$elements) {
 
   // Until now, we rendered the children, here we render the element itself
   if (!isset($elements['#printed'])) {
-    $content = theme(($elements['#type']) ? $elements['#type']: 'markup', $elements);
+    $content = theme((isset($elements['#type']) ? $elements['#type'] : 'markup'), $elements);
     $elements['#printed'] = TRUE;
   }
 
@@ -624,9 +624,9 @@ function form_options_flatten($array, $r
  */
 function theme_select($element) {
   $select = '';
-  $size = $element['#size'] ? ' size="' . $element['#size'] . '"' : '';
+  $size = isset($element['#size']) ? ' size="' . $element['#size'] . '"' : '';
   _form_set_class($element, array('form-select'));
-  return theme('form_element', $element['#title'], '<select name="'. $element['#name'] .''. ($element['#multiple'] ? '[]' : '') .'"'. ($element['#multiple'] ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) .' id="' . $element['#id'] .'" '. $size .'>'. form_select_options($element) .'</select>', $element['#description'], $element['#id'], $element['#required'], form_get_error($element));
+  return theme('form_element', isset($element['#title']) ? $element['#title'] : '', '<select name="'. $element['#name'] .''. (isset($element['#multiple']) ? '[]' : '') .'"'. (isset($element['#multiple']) ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) .' id="' . $element['#id'] .'" '. $size .'>'. form_select_options($element) .'</select>', $element['#description'], $element['#id'], $element['#required'], form_get_error($element));
 }
 
 function form_select_options($element, $choices = NULL) {
@@ -671,13 +671,16 @@ function theme_fieldset($element) {
   if ($element['#collapsible']) {
     drupal_add_js('misc/collapse.js');
 
+    if (!isset($element['#attributes']['class'])) {
+      $element['#attributes']['class'] = '';
+    }
     $element['#attributes']['class'] .= ' collapsible';
     if ($element['#collapsed']) {
      $element['#attributes']['class'] .= ' collapsed';
     }
   }
 
-  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";
+  return '<fieldset' . drupal_attributes($element['#attributes']) .'>' . ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . ($element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . $element['#children'] . (isset($element['#value']) ? $element['#value'] : '') . "</fieldset>\n";
 
 }
 
@@ -713,11 +716,11 @@ function theme_radio($element) {
  *   A themed HTML string representing the radio button set.
  */
 function theme_radios($element) {
-  if ($element['#title'] || $element['#description']) {
-    return theme('form_element', $element['#title'], $element['#children'], $element['#description'], NULL, $element['#required'], form_get_error($element));
+  if (isset($element['#title']) || isset($element['#description'])) {
+    return theme('form_element', isset($element['#title']) ? $element['#title'] : '', isset($element['#children']) ? $element['#children'] : '', isset($element['#description']) ? $element['#description'] : '', NULL, $element['#required'], form_get_error($element));
   }
   else {
-    return $element['#children'];
+    return isset($element['#children']) ? $element['#children'] : '';
   }
 }
 
@@ -853,8 +856,10 @@ function map_month($month) {
  */
 function checkboxes_value(&$form) {
   $value = array();
-  foreach ((array)$form['#default_value'] as $key) {
-    $value[$key] = 1;
+  if (isset($form['#default_value'])) {
+    foreach ((array)$form['#default_value'] as $key) {
+      $value[$key] = 1;
+    }
   }
   $form['#value'] = $value;
 }
@@ -878,7 +883,7 @@ function weight_value(&$form) {
 function expand_radios($element) {
   if (count($element['#options']) > 0) {
     foreach ($element['#options'] as $key => $choice) {
-      if (!$element[$key]) {
+      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);
       }
     }
@@ -896,7 +901,7 @@ function expand_radios($element) {
  *   A themed HTML string representing the form item.
  */
 function theme_item($element) {
-  return theme('form_element', $element['#title'], $element['#value'] . $element['#children'], $element['#description'], $element['#id'], $element['#required'], $element['#error']);
+  return theme('form_element', isset($element['#title']) ? $element['#title'] : '', $element['#value'] . (isset($element['#children']) ? $element['#children'] : ''), $element['#description'], isset($element['#id']) ? $element['#id'] : '', $element['#required'], isset($element['#error']) ? $element['#error'] : '');
 }
 
 /**
@@ -918,8 +923,8 @@ function theme_checkbox($element) {
   $checkbox .= $element['#value'] ? ' checked="checked" ' : ' ';
   $checkbox .= drupal_attributes($element['#attributes']) . ' />';
 
-  if (!is_null($element['#title'])) {
-    $checkbox = '<label class="option">'. $checkbox .' '. $element['#title'] .'</label>';
+  if (!isset($element['#title'])) {
+    $checkbox = '<label class="option">'. $checkbox .' '. (isset($element['#title']) ? $element['#title'] : '') .'</label>';
   }
 
   return theme('form_element', NULL, $checkbox, $element['#description'], $element['#id'], $element['#required'], form_get_error($element));
@@ -934,11 +939,11 @@ function theme_checkbox($element) {
  *   A themed HTML string representing the checkbox set.
  */
 function theme_checkboxes($element) {
-  if ($element['#title'] || $element['#description']) {
-    return theme('form_element', $element['#title'], $element['#children'], $element['#description'], NULL, $element['#required'], form_get_error($element));
+  if (isset($element['#title']) || isset($element['#description'])) {
+    return theme('form_element', isset($element['#title']) ? $element['#title'] : '', isset($element['#children']) ? $element['#children'] : '', isset($element['#description']) ? $element['#description'] : '', NULL, $element['#required'], form_get_error($element));
   }
   else {
-    return $element['#children'];
+    return isset($element['#children']) ? $element['#children'] : '';
   }
 }
 
@@ -1036,7 +1041,7 @@ function theme_form($element) {
  */
 function theme_textarea($element) {
   $class = array('form-textarea');
-  if ($element['#resizable'] !== false) {
+  if (!isset($element['#resizable']) || $element['#resizable'] !== false) {
     drupal_add_js('misc/textarea.js');
     $class[] = 'resizable';
   }
@@ -1059,7 +1064,7 @@ function theme_textarea($element) {
  */
 
 function theme_markup($element) {
-  return $element['#value'] . $element['#children'];
+  return (isset($element['#value']) ? $element['#value'] : '') . (isset($element['#children']) ? $element['#children'] : '');
 }
 
 /**
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.292.2.3
diff -u -p -r1.292.2.3 theme.inc
--- includes/theme.inc	2 May 2006 13:04:49 -0000	1.292.2.3
+++ includes/theme.inc	27 May 2006 09:52:30 -0000
@@ -516,6 +516,7 @@ function theme_links($links, $delimiter 
  *   A string containing the image tag.
  */
 function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {
+  $image_attributes = '';
   if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
     $attributes = drupal_attributes($attributes);
     return '<img src="'. check_url(base_path() . $path) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .' />';
Index: modules/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block.module,v
retrieving revision 1.206.2.1
diff -u -p -r1.206.2.1 block.module
--- modules/block.module	21 May 2006 13:49:07 -0000	1.206.2.1
+++ modules/block.module	27 May 2006 09:52:31 -0000
@@ -297,7 +297,7 @@ function theme_block_admin_display($form
   foreach (element_children($form) as $i) {
     $block = $form[$i];
     // Only take form elements that are blocks.
-    if (is_array($block['info'])) {
+    if (isset($block['info']) && is_array($block['info'])) {
       // Fetch values
       $region = $block['region']['#default_value'];
       $status = $block['status']['#default_value'];
@@ -325,7 +325,7 @@ function theme_block_admin_display($form
         $row[] = form_render($block['throttle']);
       }
       $row[] = form_render($block['configure']);
-      $row[] = $block['delete'] ? form_render($block['delete']) : '';
+      $row[] = isset($block['delete']) ? form_render($block['delete']) : '';
       $rows[] = $row;
     }
   }
Index: modules/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment.module,v
retrieving revision 1.455.2.2
diff -u -p -r1.455.2.2 comment.module
--- modules/comment.module	23 May 2006 09:51:18 -0000	1.455.2.2
+++ modules/comment.module	27 May 2006 09:52:34 -0000
@@ -938,9 +938,9 @@ function comment_operations($action = NU
  * Menu callback; present an administrative comment listing.
  */
 function comment_admin_overview($type = 'new') {
-  $edit = $_POST['edit'];
+  $edit = isset($_POST['edit']) ? $_POST['edit'] : NULL;
 
-  if ($edit['operation'] == 'delete') {
+  if (isset($edit['operation']) && $edit['operation'] == 'delete') {
     return comment_multiple_delete_confirm();
   }
 
@@ -969,6 +969,7 @@ function comment_admin_overview($type = 
 
   // build a table listing the appropriate comments
   $destination = drupal_get_destination();
+  $comments = array();
   while ($comment = db_fetch_object($result)) {
     $comments[$comment->cid] = '';
     $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
@@ -1657,7 +1658,7 @@ function _comment_per_page() {
  */
 function _comment_get_display_setting($setting) {
   global $user;
-  
+
   if ($_GET[$setting]) {
     $value = $_GET[$setting];
   }
Index: modules/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter.module,v
retrieving revision 1.122.2.1
diff -u -p -r1.122.2.1 filter.module
--- modules/filter.module	4 May 2006 11:13:00 -0000	1.122.2.1
+++ modules/filter.module	27 May 2006 09:52:36 -0000
@@ -622,6 +622,7 @@ function filter_formats() {
     $formats = array();
 
     $query = 'SELECT * FROM {filter_formats}';
+    $args = array();
 
     // Build query for selecting the format(s) based on the user's roles.
     if (!$all) {
Index: modules/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node.module,v
retrieving revision 1.641.2.5
diff -u -p -r1.641.2.5 node.module
--- modules/node.module	14 May 2006 23:57:58 -0000	1.641.2.5
+++ modules/node.module	27 May 2006 09:52:40 -0000
@@ -1013,7 +1013,7 @@ function node_filter_form() {
  * Theme node administration filter form.
  */
 function theme_node_filter_form(&$form) {
-  $output .= '<div id="node-admin-filter">';
+  $output = '<div id="node-admin-filter">';
   $output .= form_render($form['filters']);
   $output .= '</div>';
   $output .= form_render($form);
@@ -1024,14 +1024,14 @@ function theme_node_filter_form(&$form) 
  * Theme node administraton filter selector.
  */
 function theme_node_filters(&$form) {
-  $output .= '<ul>';
-  if (sizeof($form['current'])) {
+  $output = '<ul>';
+  if (isset($form['current']) && sizeof($form['current'])) {
     foreach (element_children($form['current']) as $key) {
       $output .= '<li>' . form_render($form['current'][$key]) . '</li>';
     }
   }
 
-  $output .= '<li><dl class="multiselect">' . (sizeof($form['current']) ? '<dt><em>'. t('and') .'</em> '. t('where') .'</dt>' : '') . '<dd class="a">';
+  $output .= '<li><dl class="multiselect">' . (isset($form['current']) && sizeof($form['current']) ? '<dt><em>'. t('and') .'</em> '. t('where') .'</dt>' : '') . '<dd class="a">';
   foreach (element_children($form['filter']) as $key) {
     $output .= form_render($form['filter'][$key]);
   }
@@ -1117,7 +1117,7 @@ function node_admin_nodes() {
   global $form_values;
   $output = node_filter_form();
 
-  if ($_POST['edit']['operation'] == 'delete' && $_POST['edit']['nodes']) {
+  if (isset($_POST['edit']['operation']) && $_POST['edit']['operation'] == 'delete' && isset($_POST['edit']['nodes'])) {
     return node_multiple_delete_confirm();
   }
 
@@ -1162,7 +1162,7 @@ function theme_node_admin_nodes($form) {
   // Overview table:
   $header = array(NULL, t('Title'), t('Type'), t('Author'), t('Status'), t('Operations'));
 
-  $output .= form_render($form['options']);
+  $output = form_render($form['options']);
   if (isset($form['title']) && is_array($form['title'])) {
     foreach (element_children($form['title']) as $key) {
       $row = array();
@@ -1661,7 +1661,7 @@ function node_form_array($node) {
 
 function node_form_add_preview($form) {
   global $form_values;
-  
+
   $op = isset($_POST['op']) ? $_POST['op'] : '';
   if ($op == t('Preview')) {
     drupal_validate_form($form['form_id']['#value'], $form);
Index: modules/path.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/path.module,v
retrieving revision 1.83
diff -u -p -r1.83 path.module
--- modules/path.module	13 Apr 2006 08:25:27 -0000	1.83
+++ modules/path.module	27 May 2006 09:52:40 -0000
@@ -298,11 +298,12 @@ function path_overview() {
   $result = pager_query($sql, 50);
 
   $destination = drupal_get_destination();
+  $rows = array();
   while ($data = db_fetch_object($result)) {
     $rows[] = array($data->dst, $data->src, l(t('edit'), "admin/path/edit/$data->pid", array(), $destination), l(t('delete'), "admin/path/delete/$data->pid", array(), $destination));
   }
 
-  if (!$rows) {
+  if (empty($rows)) {
     $rows[] = array(array('data' => t('No URL aliases available.'), 'colspan' => '4'));
   }
 
Index: modules/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system.module,v
retrieving revision 1.320.2.3
diff -u -p -r1.320.2.3 system.module
--- modules/system.module	15 May 2006 00:28:58 -0000	1.320.2.3
+++ modules/system.module	27 May 2006 09:52:42 -0000
@@ -593,7 +593,7 @@ function system_theme_data() {
       $style->template = isset($theme->template) ? $theme->template : FALSE;
       $style->name = basename(dirname($style->filename));
       $style->owner = $theme->filename;
-      $style->prefix = $theme->template ? $theme->prefix : $theme->name;
+      $style->prefix = isset($theme->template) ? $theme->prefix : $theme->name;
       // do not double-insert styles with theme files in their directory
       if (array_key_exists($style->name, $themes)) {
         continue;
@@ -837,7 +837,7 @@ function system_themes() {
 function theme_system_themes($form) {
   foreach (element_children($form) as $key) {
     $row = array();
-    if (is_array($form[$key]['description'])) {
+    if (isset($form[$key]['description']) && is_array($form[$key]['description'])) {
       $row[] = form_render($form[$key]['screenshot']);
       $row[] = form_render($form[$key]['description']);
       $row[] = array('data' => form_render($form['status'][$key]), 'align' => 'center');
Index: modules/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy.module,v
retrieving revision 1.275.2.7
diff -u -p -r1.275.2.7 taxonomy.module
--- modules/taxonomy.module	24 May 2006 18:21:40 -0000	1.275.2.7
+++ modules/taxonomy.module	27 May 2006 09:52:44 -0000
@@ -758,10 +758,10 @@ function taxonomy_node_save($nid, $terms
           $typed_term_tid = $edit['tid'];
         }
 
-        // defend against duplicate, different cased tags
-        if (!isset($inserted[$typed_term_tid])) {
-          db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $typed_term_tid);
-          $inserted[$typed_term_tid] = TRUE;
+        // defend against duplicate, different cased tags
+        if (!isset($inserted[$typed_term_tid])) {
+          db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $typed_term_tid);
+          $inserted[$typed_term_tid] = TRUE;
         }
       }
     }
@@ -908,7 +908,7 @@ function taxonomy_get_tree($vid, $parent
         $terms[$vid][$child]->parents = $parents[$vid][$child];
         $tree[] = $terms[$vid][$child];
 
-        if ($children[$vid][$child]) {
+        if (isset($children[$vid][$child])) {
           $tree = array_merge($tree, taxonomy_get_tree($vid, $child, $depth, $max_depth));
         }
       }
@@ -1067,6 +1067,7 @@ function theme_taxonomy_term_select($ele
 }
 
 function _taxonomy_depth($depth, $graphic = '--') {
+  $result = '';
   for ($n = 0; $n < $depth; $n++) {
     $result .= $graphic;
   }
Index: modules/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user.module,v
retrieving revision 1.612.2.10
diff -u -p -r1.612.2.10 user.module
--- modules/user.module	23 May 2006 09:39:47 -0000	1.612.2.10
+++ modules/user.module	27 May 2006 09:52:48 -0000
@@ -1717,7 +1717,7 @@ function user_admin_perm($str_rids = NUL
     $rids = preg_split('/[+ ]/', $str_rids);
   }
 
-  if($rids) {
+  if(isset($rids)) {
     $breadcrumbs = drupal_get_breadcrumb();
     $breadcrumbs[] = l(t('all roles'), 'admin/access');
     drupal_set_breadcrumb($breadcrumbs);
@@ -1733,7 +1733,7 @@ function user_admin_perm($str_rids = NUL
     $role_permissions[$role->rid] = $role->perm;
   }
 
-  if($rids) {
+  if(isset($rids)) {
     $result = db_query('SELECT rid, name FROM {role} r WHERE r.rid IN (%s) ORDER BY name', implode(', ', $rids));
   }
   else {
Index: themes/engines/phptemplate/phptemplate.engine
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v
retrieving revision 1.33.2.1
diff -u -p -r1.33.2.1 phptemplate.engine
--- themes/engines/phptemplate/phptemplate.engine	24 May 2006 11:00:45 -0000	1.33.2.1
+++ themes/engines/phptemplate/phptemplate.engine	27 May 2006 09:52:49 -0000
@@ -248,6 +248,7 @@ function phptemplate_node($node, $teaser
     $variables['picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $node) : '';
   }
   else {
+    $variables['submitted'] = '';
     $variables['picture'] = '';
   }
 
