Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.35
diff -u -p -r1.35 install.php
--- install.php	24 Jan 2007 14:48:35 -0000	1.35
+++ install.php	25 Jan 2007 15:56:31 -0000
@@ -20,6 +20,7 @@ function install_main() {
   drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
   require_once './modules/system/system.install';
   require_once './includes/file.inc';
+  require_once './includes/database.inc';
 
   // Ensure correct page headers are sent (e.g. caching)
   drupal_page_header();
@@ -30,7 +31,6 @@ function install_main() {
   // Drupal may already be installed.
   if ($verify) {
     // Establish a connection to the database.
-    require_once './includes/database.inc';
     db_set_active();
     // Check if Drupal is installed.
     if (install_verify_drupal()) {
@@ -118,15 +118,11 @@ function install_verify_settings() {
     // We need this because we want to run form_get_errors.
     include_once './includes/form.inc';
 
-    $url = parse_url(is_array($db_url) ? $db_url['default'] : $db_url);
-    $db_user = urldecode($url['user']);
-    $db_pass = urldecode($url['pass']);
-    $db_host = urldecode($url['host']);
-    $db_port = isset($url['port']) ? urldecode($url['port']) : '';
-    $db_path = ltrim(urldecode($url['path']), '/');
+    $url = db_decode_url(parse_url(is_array($db_url) ? $db_url['default'] : $db_url));
+    $url['path'] = ltrim($url['path'], '/');
     $settings_file = './'. conf_path() .'/settings.php';
 
-    _install_settings_form_validate($db_prefix, $db_type, $db_user, $db_pass, $db_host, $db_port, $db_path, $settings_file);
+    _install_settings_form_validate($db_prefix, $db_type, $url['user'], $url['pass'], $url['host'], $url['port'], $url['path'], $settings_file);
     if (!form_get_errors()) {
       return TRUE;
     }
@@ -139,13 +135,9 @@ function install_verify_settings() {
  */
 function install_change_settings($profile = 'default', $install_locale = '') {
   global $db_url, $db_type, $db_prefix;
-
-  $url = parse_url(is_array($db_url) ? $db_url['default'] : $db_url);
-  $db_user = urldecode($url['user']);
-  $db_pass = urldecode($url['pass']);
-  $db_host = urldecode($url['host']);
-  $db_port = isset($url['port']) ? urldecode($url['port']) : '';
-  $db_path = ltrim(urldecode($url['path']), '/');
+  
+  $url = db_decode_url(parse_url(is_array($db_url) ? $db_url['default'] : $db_url));
+  $url['path'] = ltrim($url['path'], '/');
   $settings_file = './'. conf_path() .'/settings.php';
 
   // We always need this because we want to run form_get_errors.
@@ -164,9 +156,9 @@ function install_change_settings($profil
 
   // Don't fill in placeholders
   if ($db_url == 'mysql://username:password@localhost/databasename') {
-    $db_user = $db_pass = $db_path = '';
+    $url['user'] = $url['pass'] = $url['path'] = '';
   }
-  $output = drupal_get_form('install_settings_form', $profile, $install_locale, $settings_file, $db_url, $db_type, $db_prefix, $db_user, $db_pass, $db_host, $db_port, $db_path);
+  $output = drupal_get_form('install_settings_form', $profile, $install_locale, $settings_file, $db_url, $db_type, $db_prefix, $url['user'], $url['pass'], $url['host'], $url['port'], $url['path']);
   drupal_set_title(st('Database configuration'));
   print theme('install_page', $output);
   exit;
@@ -539,7 +531,7 @@ function install_complete($profile) {
   // Build final page.
   drupal_maintenance_theme();
   drupal_set_title(st('@drupal installation complete', array('@drupal' => drupal_install_profile_name())));
-  $output .= '<p>'. st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) .'</p>';
+  $output = '<p>'. st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) .'</p>';
 
   // Show profile finalization info.
   $function = $profile .'_profile_final';
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.613
diff -u -p -r1.613 common.inc
--- includes/common.inc	24 Jan 2007 14:48:35 -0000	1.613
+++ includes/common.inc	25 Jan 2007 15:56:35 -0000
@@ -1454,6 +1454,8 @@ function drupal_get_css($css = NULL) {
   $preprocess_css = variable_get('preprocess_css', FALSE);
   $directory = file_directory_path();
   $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
+  $no_module_preprocess = '';
+  $no_theme_preprocess = '';
 
   foreach ($css as $media => $types) {
     // If CSS preprocessing is off, we still need to output the styles.
Index: includes/database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.inc,v
retrieving revision 1.62
diff -u -p -r1.62 database.inc
--- includes/database.inc	3 Jan 2007 10:59:02 -0000	1.62
+++ includes/database.inc	25 Jan 2007 15:56:36 -0000
@@ -309,6 +309,31 @@ function db_escape_table($string) {
 }
 
 /**
+ * Decode all components of a database url.
+ *
+ * @param $url
+ *    An array of url components generated by parse_url().
+ */
+function db_decode_url($url) {
+  $components = array('user', 'pass', 'host', 'path');
+  foreach ($components as $key) {
+    if (isset($url[$key])) {
+      $url[$key] = urldecode($url[$key]);
+    }
+    else {
+      // Default to '' for E_ALL compliance.
+      $url[$key] = '';
+    }
+  }
+
+  // Set $url['port'] for E_ALL compliance.
+  if (!isset($url['port'])) {
+    $url['port'] = '';
+  }
+  return $url;
+}
+
+/**
  * @} End of "defgroup database".
  */
 
Index: includes/database.mysql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.mysql.inc,v
retrieving revision 1.67
diff -u -p -r1.67 database.mysql.inc
--- includes/database.mysql.inc	22 Jan 2007 02:20:42 -0000	1.67
+++ includes/database.mysql.inc	25 Jan 2007 15:56:36 -0000
@@ -53,7 +53,8 @@ function db_version() {
  * (e.g. your database and web server live on different machines).
  */
 function db_connect($url) {
-  $url = parse_url($url);
+  // Decode url-encoded information in the db connection string.
+  $url = db_decode_url(parse_url($url));
 
   // Check if MySQL support is present in PHP
   if (!function_exists('mysql_connect')) {
@@ -69,20 +70,8 @@ function db_connect($url) {
     exit;
   }
 
-  // Decode url-encoded information in the db connection string
-  $url['user'] = urldecode($url['user']);
-  // Test if database url has a password.
-  if(isset($url['pass'])) {
-    $url['pass'] = urldecode($url['pass']);
-  }
-  else {
-    $url['pass'] = '';
-  }
-  $url['host'] = urldecode($url['host']);
-  $url['path'] = urldecode($url['path']);
-
   // Allow for non-standard MySQL port.
-  if (isset($url['port'])) {
+  if ($url['port'] !== '') {
      $url['host'] = $url['host'] .':'. $url['port'];
   }
 
Index: includes/database.mysqli.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.mysqli.inc,v
retrieving revision 1.32
diff -u -p -r1.32 database.mysqli.inc
--- includes/database.mysqli.inc	27 Dec 2006 22:50:09 -0000	1.32
+++ includes/database.mysqli.inc	25 Jan 2007 15:56:37 -0000
@@ -62,19 +62,8 @@ function db_connect($url) {
     exit;
   }
 
-  $url = parse_url($url);
-
-  // Decode url-encoded information in the db connection string
-  $url['user'] = urldecode($url['user']);
-  // Test if database url has a password.
-  if(isset($url['pass'])) {
-    $url['pass'] = urldecode($url['pass']);
-  }
-  else {
-    $url['pass'] = '';
-  }
-  $url['host'] = urldecode($url['host']);
-  $url['path'] = urldecode($url['path']);
+  // Decode url-encoded information in the db connection string.
+  $url = db_decode_url(parse_url($url));
 
   $connection = mysqli_init();
   @mysqli_real_connect($connection, $url['host'], $url['user'], $url['pass'], substr($url['path'], 1), $url['port'], NULL, MYSQLI_CLIENT_FOUND_ROWS);
Index: includes/database.pgsql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.pgsql.inc,v
retrieving revision 1.43
diff -u -p -r1.43 database.pgsql.inc
--- includes/database.pgsql.inc	27 Dec 2006 22:13:56 -0000	1.43
+++ includes/database.pgsql.inc	25 Jan 2007 15:56:38 -0000
@@ -60,24 +60,24 @@ function db_connect($url) {
     exit;
   }
 
-  $url = parse_url($url);
+  // Decode url-encoded information in the db connection string.
+  $url = db_decode_url(parse_url($url));
   $conn_string = '';
 
-  // Decode url-encoded information in the db connection string
-  if (isset($url['user'])) {
-    $conn_string .= ' user=' . urldecode($url['user']);
+  if ($url['user'] !== '') {
+    $conn_string .= ' user='. $url['user'];
   }
-  if (isset($url['pass'])) {
-    $conn_string .= ' password=' . urldecode($url['pass']);
+  if ($url['pass'] !== '') {
+    $conn_string .= ' password='. $url['pass'];
   }
-  if (isset($url['host'])) {
-    $conn_string .= ' host=' . urldecode($url['host']);
+  if ($url['host'] !== '') {
+    $conn_string .= ' host='. $url['host'];
   }
-  if (isset($url['path'])) {
-    $conn_string .= ' dbname=' . substr(urldecode($url['path']), 1);
+  if ($url['path'] !== '') {
+    $conn_string .= ' dbname='. substr($url['path'], 1);
   }
-  if (isset($url['port'])) {
-    $conn_string .= ' port=' . urldecode($url['port']);
+  if ($url['port'] !== '') {
+    $conn_string .= ' port='. $url['port'];
   }
 
   // pg_last_error() does not return a useful error message for database
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.175
diff -u -p -r1.175 form.inc
--- includes/form.inc	23 Jan 2007 19:17:55 -0000	1.175
+++ includes/form.inc	25 Jan 2007 15:56:39 -0000
@@ -246,6 +246,7 @@ function drupal_process_form($form_id, &
   $form_values = array();
   $form_submitted = FALSE;
   $form_button_counter = array(0, 0);
+  $redirect = NULL;
 
   drupal_prepare_form($form_id, $form);
   if (($form['#programmed']) || (!empty($_POST) && (($_POST['form_id'] == $form_id) || ($_POST['form_id'] == $form['#base'])))) {
@@ -321,7 +322,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' => form_clean_id('edit-'. $form_id .'-form-token'),
@@ -448,6 +449,7 @@ function drupal_submit_form($form_id, $f
  *
  */
 function drupal_render_form($form_id, &$form) {
+  $base = '';
   // Don't override #theme if someone already set it.
   if (isset($form['#base'])) {
     $base = $form['#base'];
@@ -755,7 +757,7 @@ function form_builder($form_id, $form) {
   if (isset($form['#process']) && !$form['#processed']) {
     foreach ($form['#process'] as $process => $args) {
       if (function_exists($process)) {
-        $args = array_merge(array($form), array($edit), $args);
+        $args = array_merge(array($form), array((isset($edit) ? $edit : NULL)), $args);
         $form = call_user_func_array($process, $args);
       }
     }
@@ -1024,6 +1026,13 @@ function form_get_options($element, $key
  *   A themed HTML string representing the form item group.
  */
 function theme_fieldset($element) {
+  // Each key defaults to '' for E_ALL compliance.
+  $keys = array('#attributes', '#children', '#collapsible', '#description', '#title', '#value');
+  foreach ($keys as $key) {
+    if (!isset($element[$key])) {
+      $element[$key] = '';
+    }
+  }
   if ($element['#collapsible']) {
     drupal_add_js('misc/collapse.js');
 
Index: includes/install.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.inc,v
retrieving revision 1.31
diff -u -p -r1.31 install.inc
--- includes/install.inc	2 Jan 2007 05:05:38 -0000	1.31
+++ includes/install.inc	25 Jan 2007 15:56:40 -0000
@@ -64,11 +64,11 @@ function drupal_get_schema_versions($mod
 function drupal_get_installed_schema_version($module, $reset = FALSE) {
   static $versions;
 
-  if ($reset) {
+  if ($reset && isset($versions)) {
     unset($versions);
   }
 
-  if (!$versions) {
+  if (!isset($versions)) {
     $versions = array();
     $result = db_query("SELECT name, schema_version FROM {system} WHERE type = 'module'");
     while ($row = db_fetch_object($result)) {
@@ -204,7 +204,7 @@ function drupal_rewrite_settings($settin
           // Write new value to settings.php in the following format:
           //    $'setting' = 'value'; // 'comment'
           $setting = $settings[$variable[1]];
-          $buffer .= '$'. $variable[1] ." = '". $setting['value'] ."';". ($setting['comment'] ? ' // '. $setting['comment'] ."\n" : "\n");
+          $buffer .= '$'. $variable[1] ." = '". $setting['value'] ."';". (isset($setting['comment']) && $setting['comment'] ? ' // '. $setting['comment'] ."\n" : "\n");
           unset($settings[$variable[1]]);
         }
         else {
Index: includes/install.mysql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.mysql.inc,v
retrieving revision 1.4
diff -u -p -r1.4 install.mysql.inc
--- includes/install.mysql.inc	27 Dec 2006 13:02:34 -0000	1.4
+++ includes/install.mysql.inc	25 Jan 2007 15:56:40 -0000
@@ -25,17 +25,12 @@ function drupal_test_mysql($url, &$succe
     return FALSE;
   }
 
-  $url = parse_url($url);
-
   // Decode url-encoded information in the db connection string.
-  $url['user'] = urldecode($url['user']);
-  $url['pass'] = urldecode($url['pass']);
-  $url['host'] = urldecode($url['host']);
-  $url['path'] = urldecode($url['path']);
+  $url = db_decode_url(parse_url($url));
 
   // Allow for non-standard MySQL port.
-  if (isset($url['port'])) {
-     $url['host'] = $url['host'] .':'. $url['port'];
+  if ($url['port'] !== '') {
+    $url['host'] = $url['host'] .':'. $url['port'];
   }
 
   // Test connecting to the database.
Index: includes/install.mysqli.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.mysqli.inc,v
retrieving revision 1.6
diff -u -p -r1.6 install.mysqli.inc
--- includes/install.mysqli.inc	27 Dec 2006 13:02:34 -0000	1.6
+++ includes/install.mysqli.inc	25 Jan 2007 15:56:40 -0000
@@ -25,13 +25,8 @@ function drupal_test_mysqli($url, &$succ
     return FALSE;
   }
 
-  $url = parse_url($url);
-
   // Decode url-encoded information in the db connection string.
-  $url['user'] = urldecode($url['user']);
-  $url['pass'] = urldecode($url['pass']);
-  $url['host'] = urldecode($url['host']);
-  $url['path'] = urldecode($url['path']);
+  $url = db_decode_url(parse_url($url));
 
   $connection = mysqli_init();
   @mysqli_real_connect($connection, $url['host'], $url['user'], $url['pass'], substr($url['path'], 1), $url['port'], NULL, MYSQLI_CLIENT_FOUND_ROWS);
Index: includes/install.pgsql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.pgsql.inc,v
retrieving revision 1.2
diff -u -p -r1.2 install.pgsql.inc
--- includes/install.pgsql.inc	27 Dec 2006 13:02:34 -0000	1.2
+++ includes/install.pgsql.inc	25 Jan 2007 15:56:40 -0000
@@ -25,13 +25,8 @@ function drupal_test_pgsql($url, &$succe
     return FALSE;
   }
 
-  $url = parse_url($url);
-
   // Decode url-encoded information in the db connection string.
-  $url['user'] = urldecode($url['user']);
-  $url['pass'] = urldecode($url['pass']);
-  $url['host'] = urldecode($url['host']);
-  $url['path'] = urldecode($url['path']);
+  $url = db_decode_url(parse_url($url));
 
   // Build pgsql connection string and allow for non-standard PostgreSQL port.
   $conn_string = ' user='. $url['user'] .' dbname='. substr($url['path'], 1) .' password='. $url['pass'] . ' host=' . $url['host'];
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 15:56:41 -0000
@@ -127,7 +127,7 @@ function module_rebuild_cache() {
     }
     else {
       // This is a new module.
-      db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $file->name, $file->info['description'], 'module', $file->filename, $file->status, $file->throttle, $bootstrap);
+      db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $file->name, $file->info['description'], 'module', $file->filename, isset($file->status)? $file->status : 0, isset($file->throttle)? $file->throttle : 0, $bootstrap);
     }
   }
   $files = _module_build_dependents($files);
@@ -200,6 +200,10 @@ function _module_parse_info_file($filena
     else {
       $info['dependencies'] = NULL;
     }
+
+    if (!isset($info['description'])) {
+      $info['description'] = NULL;
+    }
   }
   return $info;
 }
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 15:56:42 -0000
@@ -42,7 +42,7 @@ function init_theme() {
 
   // Only select the user selected theme if it is available in the
   // list of enabled themes.
-  $theme = $user->theme && $themes[$user->theme]->status ? $user->theme : variable_get('theme_default', 'garland');
+  $theme = isset($user->theme) && $user->theme && $themes[$user->theme]->status ? $user->theme : variable_get('theme_default', 'garland');
 
   // Allow modules to override the present theme... only select custom theme
   // if it is available in the list of installed themes.
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 15:56:47 -0000
@@ -291,6 +291,13 @@ function node_type_save($info) {
   $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 = NULL;
+  }
+  if (!isset($info->min_word_count)) {
+    $info->min_word_count = NULL;
+  }
+
   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);
 
