Index: includes/file.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/file.inc,v
retrieving revision 1.90
diff -u -p -r1.90 file.inc
--- includes/file.inc	5 Jan 2007 05:32:22 -0000	1.90
+++ includes/file.inc	25 Jan 2007 20:37:36 -0000
@@ -193,7 +193,7 @@ function file_check_upload($source = 'up
   }
 
   // If a file was uploaded, process it.
-  if ($_FILES["files"]["name"][$source] && is_uploaded_file($_FILES["files"]["tmp_name"][$source])) {
+  if (isset($_FILES["files"]["name"][$source]) && is_uploaded_file($_FILES["files"]["tmp_name"][$source])) {
 
     // Check for file upload errors and return FALSE if a
     // lower level system error occurred.
@@ -253,7 +253,7 @@ function file_check_upload($source = 'up
 
   else {
     // In case of previews return previous file object.
-    if (file_exists($_SESSION['file_uploads'][$source]->filepath)) {
+    if (isset($_SESSION['file_uploads'][$source]->filepath) && file_exists($_SESSION['file_uploads'][$source]->filepath)) {
       return $_SESSION['file_uploads'][$source];
     }
   }
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.147
diff -u -p -r1.147 menu.inc
--- includes/menu.inc	24 Jan 2007 14:48:35 -0000	1.147
+++ includes/menu.inc	25 Jan 2007 20:37:37 -0000
@@ -367,7 +367,7 @@ function _menu_tree($result = NULL, $dep
       break;
     }
   }
-  if ($link['link']) {
+  if (isset($link['link'])) {
     $tree .= theme('menu_link', $link);
   }
   return array($remnant, $tree);
Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.94
diff -u -p -r1.94 module.inc
--- includes/module.inc	24 Jan 2007 14:48:35 -0000	1.94
+++ includes/module.inc	25 Jan 2007 20:37:38 -0000
@@ -110,6 +110,9 @@ function module_rebuild_cache() {
       continue;
     }
     $files[$filename]->info = $file->info;
+    if (!isset($files[$filename]->info['version'])) {
+      $files[$filename]->info['version'] = NULL;
+    }
 
     // log the critical hooks implemented by this module
     $bootstrap = 0;
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.337
diff -u -p -r1.337 theme.inc
--- includes/theme.inc	11 Jan 2007 03:36:06 -0000	1.337
+++ includes/theme.inc	25 Jan 2007 20:37:40 -0000
@@ -610,6 +610,7 @@ function theme_links($links, $attributes
 function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {
   if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
     $attributes = drupal_attributes($attributes);
+    $image_attributes = isset($image_attributes) ? $image_attributes : '';
     $url = (url($path) == $path) ? $path : (base_path() . $path);
     return '<img src="'. check_url($url) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .' />';
   }
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.248
diff -u -p -r1.248 block.module
--- modules/block/block.module	24 Jan 2007 14:48:36 -0000	1.248
+++ modules/block/block.module	25 Jan 2007 20:37:42 -0000
@@ -310,7 +310,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 = $region != BLOCK_REGION_NONE;
@@ -337,7 +337,7 @@ function theme_block_admin_display($form
         $row[] = drupal_render($block['throttle']);
       }
       $row[] = drupal_render($block['configure']);
-      $row[] = $block['delete'] ? drupal_render($block['delete']) : '';
+      $row[] = isset($block['delete']) ? drupal_render($block['delete']) : '';
       $rows[] = $row;
     }
   }
@@ -570,7 +570,7 @@ function block_box_form($edit = array())
   $form['info'] = array(
     '#type' => 'textfield',
     '#title' => t('Block description'),
-    '#default_value' => $edit['info'],
+    '#default_value' => isset($edit['info']) ? $edit['info'] : '',
     '#maxlength' => 64,
     '#description' => t('A brief description of your block. Used on the <a href="@overview">block overview page</a>.', array('@overview' => url('admin/build/block'))),
     '#required' => TRUE,
@@ -580,7 +580,7 @@ function block_box_form($edit = array())
   $form['body_filter']['body'] = array(
     '#type' => 'textarea',
     '#title' => t('Block body'),
-    '#default_value' => $edit['body'],
+    '#default_value' => isset($edit['body']) ? $edit['body'] : '',
     '#rows' => 15,
     '#description' => t('The content of the block as shown to the user.'),
     '#weight' => -17,
@@ -631,7 +631,7 @@ function block_user($type, $edit, &$user
 
       break;
     case 'validate':
-      if (!$edit['block']) {
+      if (!isset($edit['block'])) {
         $edit['block'] = array();
       }
       return $edit;
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.407
diff -u -p -r1.407 book.module
--- modules/book/book.module	24 Jan 2007 14:48:36 -0000	1.407
+++ modules/book/book.module	25 Jan 2007 20:37:44 -0000
@@ -507,7 +507,7 @@ function theme_book_navigation($node) {
  * This is a helper function for book_toc().
  */
 function book_toc_recurse($nid, $indent, $toc, $children, $exclude) {
-  if ($children[$nid]) {
+  if (isset($children[$nid])) {
     foreach ($children[$nid] as $foo => $node) {
       if (!$exclude || $exclude != $node->nid) {
         $toc[$node->nid] = $indent .' '. $node->title;
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.777
diff -u -p -r1.777 node.module
--- modules/node/node.module	24 Jan 2007 14:48:36 -0000	1.777
+++ modules/node/node.module	25 Jan 2007 20:37:50 -0000
@@ -1393,7 +1393,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 .= drupal_render($form['filters']);
   $output .= '</div>';
   $output .= drupal_render($form);
@@ -1404,8 +1404,8 @@ function theme_node_filter_form($form) {
  * Theme node administration filter selector.
  */
 function theme_node_filters($form) {
-  $output .= '<ul class="clear-block">';
-  if (sizeof($form['current'])) {
+  $output = '<ul class="clear-block">';
+  if (isset($form['current']) && sizeof($form['current'])) {
     foreach (element_children($form['current']) as $key) {
       $output .= '<li>'. drupal_render($form['current'][$key]) .'</li>';
     }
@@ -1495,7 +1495,7 @@ function node_admin_nodes_validate($form
 function node_admin_content() {
   $output = drupal_get_form('node_filter_form');
 
-  if ($_POST['operation'] == 'delete' && $_POST['nodes']) {
+  if (isset($_POST['operation']) && $_POST['operation'] == 'delete' && $_POST['nodes']) {
     return drupal_get_form('node_multiple_delete_confirm');
   }
   // Call the form first, to allow for the form_values array to be populated.
@@ -1506,6 +1506,7 @@ function node_admin_content() {
 
 function node_admin_nodes() {
   global $form_values;
+
   $filter = node_build_filter_query();
 
   $result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] .' ORDER BY n.changed DESC', 50, 0, NULL, $filter['args']);
@@ -1522,6 +1523,7 @@ function node_admin_nodes() {
   $form['options']['operation'] = array('#type' => 'select', '#options' => $options,  '#default_value' => 'approve');
   $form['options']['submit'] = array('#type' => 'submit', '#value' => t('Update'));
 
+  $nodes = array();
   $destination = drupal_get_destination();
   while ($node = db_fetch_object($result)) {
     $nodes[$node->nid] = '';
@@ -1543,7 +1545,7 @@ function theme_node_admin_nodes($form) {
   // Overview table:
   $header = array(theme('table_select_header_cell'), t('Title'), t('Type'), t('Author'), t('Status'), t('Operations'));
 
-  $output .= drupal_render($form['options']);
+  $output = drupal_render($form['options']);
   if (isset($form['title']) && is_array($form['title'])) {
     foreach (element_children($form['title']) as $key) {
       $row = array();
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.443
diff -u -p -r1.443 system.module
--- modules/system/system.module	24 Jan 2007 14:48:36 -0000	1.443
+++ modules/system/system.module	25 Jan 2007 20:37:57 -0000
@@ -354,7 +354,10 @@ function system_main_admin_page($arg = N
   usort($menu['children'], '_menu_sort');
   foreach ($menu['children'] as $mid) {
     $block = menu_get_item($mid);
-    if ($block['block callback'] && function_exists($block['block callback'])) {
+    if (!isset($block['content'])) {
+      $block['content'] = '';
+    }
+    if (isset($block['block callback']) && function_exists($block['block callback'])) {
       $arguments = isset($block['block arguments']) ? $block['block arguments'] : array();
       $block['content'] .= call_user_func_array($block['block callback'], $arguments);
     }
@@ -371,7 +374,7 @@ function system_main_admin_page($arg = N
 function system_admin_menu_block($block) {
   return 'This page awaits rewrite'; // TODO: this needs to be rewritten for the new menu system.
   $content = array();
-  if (is_array($block['children'])) {
+  if (isset($block['children']) && is_array($block['children'])) {
     usort($block['children'], '_menu_sort');
     foreach ($block['children'] as $mid) {
       $item = menu_get_item($mid);
@@ -949,7 +952,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;
@@ -1160,7 +1163,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[] = drupal_render($form[$key]['screenshot']);
       $row[] = drupal_render($form[$key]['description']);
       $row[] = array('data' => drupal_render($form['status'][$key]), 'align' => 'center');
@@ -1234,6 +1237,9 @@ function system_modules($form_values = N
     return $confirm_form;
   }
 
+  // Modules to throttle.
+  $throttle = array();
+
   // Store module list for validation callback.
   $form['validation_modules'] = array('#type' => 'value', '#value' => $files);
 
@@ -1286,7 +1292,7 @@ function system_modules($form_values = N
 
     // Mark dependents disabled so user can not remove modules being depended on.
     $dependents = array();
-    if (is_array($file->info['dependents'])) {
+    if (isset($file->info['dependents']) && is_array($file->info['dependents'])) {
       foreach ($file->info['dependents'] as $dependent) {
         if ($files[$dependent]->status == 1) {
           $dependents[] = $files[$dependent]->info['name'] . t(' (<span class="admin-enabled">enabled</span>)');
@@ -1483,7 +1489,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']) && is_array($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);
     }
@@ -1835,7 +1841,7 @@ 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']);
+  return (isset($a['weight']) && isset($b['weight'])) ? $a['weight'] - $b['weight'] : strcmp($a['title'], $b['title']);
 }
 
 /**
@@ -2168,7 +2174,7 @@ function system_admin_compact_mode() {
  */
 function theme_admin_page($blocks) {
   $stripe = 0;
-  $container = array();
+  $container = array('left' => '', 'right' => '');
 
   foreach ($blocks as $block) {
     if ($block_output = theme('admin_block', $block)) {
@@ -2323,7 +2329,7 @@ function system_get_module_admin_tasks($
 function theme_system_admin_by_module($menu_items) {
   $stripe = 0;
   $output = '';
-  $container = array();
+  $container = array('left' => '', 'right' => '');
 
   // Iterate over all modules
   foreach ($menu_items as $module => $block) {
@@ -2337,7 +2343,7 @@ function theme_system_admin_by_module($m
       $block['description'] = t($description);
 
       if ($block_output = theme('admin_block', $block)) {
-        if (!$block['position']) {
+        if (!isset($block['position'])) {
           // Perform automatic striping.
           $block['position'] = ++$stripe % 2 ? 'left' : 'right';
         }
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.332
diff -u -p -r1.332 taxonomy.module
--- modules/taxonomy/taxonomy.module	24 Jan 2007 14:48:36 -0000	1.332
+++ modules/taxonomy/taxonomy.module	25 Jan 2007 20:38:00 -0000
@@ -716,7 +716,7 @@ function taxonomy_form_alter($form_id, &
         $form['taxonomy'][$vocabulary->vid]['#required'] = $vocabulary->required;
       }
     }
-    if (is_array($form['taxonomy']) && !empty($form['taxonomy'])) {
+    if (isset($form['taxonomy']) && is_array($form['taxonomy']) && !empty($form['taxonomy'])) {
       if (count($form['taxonomy']) > 1) { // Add fieldset only if form has more than 1 element.
         $form['taxonomy'] += array(
           '#type' => 'fieldset',
Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.149
diff -u -p -r1.149 upload.module
--- modules/upload/upload.module	24 Jan 2007 14:48:36 -0000	1.149
+++ modules/upload/upload.module	25 Jan 2007 20:38:03 -0000
@@ -285,7 +285,7 @@ function _upload_prepare(&$node) {
   // Clean up old file previews if a post didn't get the user to this page.
   // i.e. the user left the edit page, because they didn't want to upload anything.
   if(count($_POST) == 0) {
-    if (is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
+    if (isset($_SESSION['file_previews']) && is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
       foreach ($_SESSION['file_previews'] as $fid => $file) {
         file_delete($file->filepath);
       }
@@ -321,7 +321,7 @@ function _upload_prepare(&$node) {
   }
 
   // Attach file previews to node object.
-  if (is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
+  if (isset($_SESSION['file_previews']) && is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
     foreach ($_SESSION['file_previews'] as $fid => $file) {
       if ($user->uid != 1) {
         // Here something.php.pps becomes something.php_.pps
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.746
diff -u -p -r1.746 user.module
--- modules/user/user.module	24 Jan 2007 14:48:36 -0000	1.746
+++ modules/user/user.module	25 Jan 2007 20:38:10 -0000
@@ -1275,12 +1275,9 @@ 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 ($form['account'] as $key => $value) {
+      $form[$key] = $value;
+    }
     unset($form['account']);
   }
   else {
@@ -1822,7 +1819,7 @@ function user_admin_access() {
   if (count($rows) == 0) {
     $rows[] = array(array('data' => '<em>'. t('There are currently no access rules.') .'</em>', 'colspan' => 5));
   }
-  $output .= theme('table', $header, $rows);
+  $output = theme('table', $header, $rows);
 
   return $output;
 }
@@ -2064,7 +2061,7 @@ function theme_user_admin_new_role($form
       $rows[] = array($name, t('locked'), $edit_permissions);
     }
   }
-  $rows[] = array(drupal_render($form['name']), array('data' => drupal_render($form['submit']), colspan => 2));
+  $rows[] = array(drupal_render($form['name']), array('data' => drupal_render($form['submit']), 'colspan' => 2));
 
   $output = drupal_render($form);
   $output .= theme('table', $header, $rows);
@@ -2413,7 +2410,7 @@ function user_admin($callback_arg = '') 
       $output = drupal_get_form('user_register');
       break;
     default:
-      if ($_POST['accounts'] && $_POST['operation'] == 'delete') {
+      if (isset($_POST['accounts']) && $_POST['operation'] == 'delete') {
         $output = drupal_get_form('user_multiple_delete_confirm');
       }
       else {
@@ -2673,7 +2670,7 @@ function theme_user_filter_form($form) {
  */
 function theme_user_filters($form) {
   $output = '<ul class="clear-block">';
-  if (sizeof($form['current'])) {
+  if (isset($form['current']) && sizeof($form['current'])) {
     foreach (element_children($form['current']) as $key) {
       $output .= '<li>'. drupal_render($form['current'][$key]) .'</li>';
     }
Index: themes/engines/phptemplate/phptemplate.engine
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v
retrieving revision 1.54
diff -u -p -r1.54 phptemplate.engine
--- themes/engines/phptemplate/phptemplate.engine	30 Dec 2006 20:59:11 -0000	1.54
+++ themes/engines/phptemplate/phptemplate.engine	25 Jan 2007 20:38:11 -0000
@@ -213,8 +213,8 @@ function phptemplate_page($content, $sho
     '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'        => isset($sidebar_left) ? $sidebar_left : '',
+    'sidebar_right'       => isset($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(),
