? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: .htaccess
===================================================================
RCS file: /cvs/drupal/drupal/.htaccess,v
retrieving revision 1.104
diff -u -p -r1.104 .htaccess
--- .htaccess	16 Aug 2009 12:10:36 -0000	1.104
+++ .htaccess	12 Oct 2009 16:52:51 -0000
@@ -35,6 +35,7 @@ DirectoryIndex index.php index.html inde
   php_flag magic_quotes_sybase              off
   php_flag register_globals                 off
   php_flag session.auto_start               off
+  php_value error_reporting                 2147483647
   php_value mbstring.http_input             pass
   php_value mbstring.http_output            pass
   php_flag mbstring.encoding_translation    off
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal/drupal/CHANGELOG.txt,v
retrieving revision 1.345
diff -u -p -r1.345 CHANGELOG.txt
--- CHANGELOG.txt	12 Oct 2009 05:22:56 -0000	1.345
+++ CHANGELOG.txt	12 Oct 2009 16:52:53 -0000
@@ -79,6 +79,8 @@ Drupal 7.0, xxxx-xx-xx (development vers
     * If your site is being upgraded from Drupal 6 and you do not have the
       contributed date or event modules installed, user time zone settings will
       fallback to the system time zone and will have to be reconfigured by each user.
+    * User-configured time zones now serve as the default time zone for PHP
+      date/time functions.
 - Filter system:
     * Revamped the filter API and text format storage.
     * Added support for default text formats to be assigned on a per-role basis.
Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.213
diff -u -p -r1.213 install.php
--- install.php	12 Oct 2009 02:00:04 -0000	1.213
+++ install.php	12 Oct 2009 16:52:54 -0000
@@ -1198,7 +1198,8 @@ function install_select_locale(&$install
       if ($install_state['interactive']) {
         drupal_set_title(st('Choose language'));
         include_once DRUPAL_ROOT . '/includes/form.inc';
-        return drupal_render(drupal_get_form('install_select_locale_form', $locales));
+        $elements = drupal_get_form('install_select_locale_form', $locales);
+        return drupal_render($elements);
       }
       else {
         throw new Exception(st('Sorry, you must select a language to continue the installation.'));
Index: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.307
diff -u -p -r1.307 update.php
--- update.php	9 Oct 2009 07:48:06 -0000	1.307
+++ update.php	12 Oct 2009 16:52:54 -0000
@@ -30,7 +30,8 @@ define('MAINTENANCE_MODE', 'update');
 
 function update_selection_page() {
   drupal_set_title('Drupal database update');
-  $output = drupal_render(drupal_get_form('update_script_selection_form'));
+  $elements = drupal_get_form('update_script_selection_form');
+  $output = drupal_render($elements);
 
   update_task_list('select');
 
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.309
diff -u -p -r1.309 bootstrap.inc
--- includes/bootstrap.inc	9 Oct 2009 16:33:13 -0000	1.309
+++ includes/bootstrap.inc	12 Oct 2009 16:52:54 -0000
@@ -453,9 +453,6 @@ function drupal_environment_initialize()
     $_SERVER['HTTP_HOST'] = '';
   }
 
-  // Enforce E_ALL, but allow users to set levels not part of E_ALL.
-  error_reporting(E_ALL | error_reporting());
-
   // Override PHP settings required for Drupal to work properly.
   // sites/default/default.settings.php contains more runtime settings.
   // The .htaccess file contains settings that cannot be changed at runtime.
@@ -1513,6 +1510,7 @@ function _drupal_bootstrap($phase) {
     case DRUPAL_BOOTSTRAP_SESSION:
       require_once DRUPAL_ROOT . '/' . variable_get('session_inc', 'includes/session.inc');
       drupal_session_initialize();
+      date_default_timezone_set(drupal_get_user_timezone());
       break;
 
     case DRUPAL_BOOTSTRAP_PAGE_HEADER:
@@ -1549,6 +1547,21 @@ function _drupal_bootstrap($phase) {
 }
 
 /**
+ * Return the time zone of the current user.
+ */
+function drupal_get_user_timezone() {
+  global $user;
+  if (variable_get('configurable_timezones', 1) && $user->uid && $user->timezone) {
+    return $user->timezone;
+  }
+  else {
+    // Ignore PHP strict notice if time zone has not yet been set in the php.ini
+    // configuration.
+    return variable_get('date_default_timezone', @date_default_timezone_get());
+  }
+}
+
+/**
  * Validate the HMAC and timestamp of a user agent header from simpletest.
  */
 function drupal_valid_test_ua($user_agent) {
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1013
diff -u -p -r1.1013 common.inc
--- includes/common.inc	11 Oct 2009 06:05:53 -0000	1.1013
+++ includes/common.inc	12 Oct 2009 16:52:56 -0000
@@ -1187,7 +1187,7 @@ function _drupal_log_error($error, $fata
     // Display the message if the current error reporting level allows this type
     // of message to be displayed, and unconditionnaly in update.php.
     $error_level = variable_get('error_level', ERROR_REPORTING_DISPLAY_ALL);
-    $display_error = $error_level == ERROR_REPORTING_DISPLAY_ALL || ($error_level == ERROR_REPORTING_DISPLAY_SOME && $error['%type'] != 'Notice');
+    $display_error = $error_level == ERROR_REPORTING_DISPLAY_ALL || ($error_level == ERROR_REPORTING_DISPLAY_SOME && $error['%type'] != 'Notice' && $error['%type'] != 'Strict warning');
     if ($display_error || (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update')) {
       $class = 'error';
 
@@ -2260,13 +2260,7 @@ function format_interval($timestamp, $gr
 function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL) {
   $timezones = &drupal_static(__FUNCTION__, array());
   if (!isset($timezone)) {
-    global $user;
-    if (variable_get('configurable_timezones', 1) && $user->uid && $user->timezone) {
-      $timezone = $user->timezone;
-    }
-    else {
-      $timezone = variable_get('date_default_timezone', 'UTC');
-    }
+    $timezone = date_default_timezone_get();
   }
   // Store DateTimeZone objects in an array rather than repeatedly
   // contructing identical objects over the life of a request.
Index: includes/locale.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/locale.inc,v
retrieving revision 1.231
diff -u -p -r1.231 locale.inc
--- includes/locale.inc	9 Oct 2009 16:33:13 -0000	1.231
+++ includes/locale.inc	12 Oct 2009 16:52:57 -0000
@@ -1055,7 +1055,8 @@ function locale_translate_seek_screen() 
   // Add CSS.
   drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', array('preprocess' => FALSE));
 
-  $output = drupal_render(drupal_get_form('locale_translation_filter_form'));
+  $elements = drupal_get_form('locale_translation_filter_form');
+  $output = drupal_render($elements);
   $output .= _locale_translate_seek();
   return $output;
 }
@@ -1294,9 +1295,11 @@ function locale_translate_export_screen(
   $output = '';
   // Offer translation export if any language is set up.
   if (count($names)) {
-    $output = drupal_render(drupal_get_form('locale_translate_export_po_form', $names));
+    $elements = drupal_get_form('locale_translate_export_po_form', $names);
+    $output = drupal_render($elements);
   }
-  $output .= drupal_render(drupal_get_form('locale_translate_export_pot_form'));
+  $elements = drupal_get_form('locale_translate_export_pot_form');
+  $output .= drupal_render($elements);
   return $output;
 }
 
Index: includes/session.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/session.inc,v
retrieving revision 1.72
diff -u -p -r1.72 session.inc
--- includes/session.inc	28 Sep 2009 22:22:54 -0000	1.72
+++ includes/session.inc	12 Oct 2009 16:52:57 -0000
@@ -300,6 +300,7 @@ function drupal_session_regenerate() {
       ->condition('sid', $old_session_id)
       ->execute();
   }
+  date_default_timezone_set(drupal_get_user_timezone());
 }
 
 /**
Index: includes/filetransfer/filetransfer.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/filetransfer/filetransfer.inc,v
retrieving revision 1.4
diff -u -p -r1.4 filetransfer.inc
--- includes/filetransfer/filetransfer.inc	28 Aug 2009 07:51:55 -0000	1.4
+++ includes/filetransfer/filetransfer.inc	12 Oct 2009 16:52:57 -0000
@@ -24,7 +24,8 @@ abstract class FileTransfer {
     $this->jail = $jail;
   }
 
-  abstract static function factory($jail, $settings);
+  static function factory($jail, $settings) {
+  }
 
   /**
    * Implementation of the magic __get() method. If the connection isn't set to
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.518
diff -u -p -r1.518 book.module
--- modules/book/book.module	11 Oct 2009 03:07:17 -0000	1.518
+++ modules/book/book.module	12 Oct 2009 16:52:58 -0000
@@ -709,7 +709,11 @@ function book_children($book_link) {
     }
   }
 
-  return $children ? drupal_render(menu_tree_output($children)) : '';
+  if ($children) {
+    $elements = menu_tree_output($children);
+    return drupal_render($elements);
+  }
+  return '';
 }
 
 /**
Index: modules/field/field.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.test,v
retrieving revision 1.58
diff -u -p -r1.58 field.test
--- modules/field/field.test	2 Oct 2009 14:39:43 -0000	1.58
+++ modules/field/field.test	12 Oct 2009 16:52:58 -0000
@@ -18,7 +18,7 @@ class FieldTestCase extends DrupalWebTes
   function setUp() {
     // Call parent::setUp().
     $args = func_get_args();
-    call_user_func_array(array('parent', 'setUp'), $args);
+    call_user_func_array(array($this, 'parent::setUp'), $args);
     // Set default storage backend.
     variable_set('field_storage_default', $this->default_storage);
   }
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.296
diff -u -p -r1.296 filter.module
--- modules/filter/filter.module	10 Oct 2009 21:39:02 -0000	1.296
+++ modules/filter/filter.module	12 Oct 2009 16:52:59 -0000
@@ -552,7 +552,8 @@ function filter_default_format($account 
   }
   // Get a list of formats for this user, ordered by weight. The first one
   // available is the user's default format.
-  $format = array_shift(filter_formats($account));
+  $formats = filter_formats($account);
+  $format = array_shift($formats);
   return $format->format;
 }
 
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.522
diff -u -p -r1.522 forum.module
--- modules/forum/forum.module	11 Oct 2009 03:07:18 -0000	1.522
+++ modules/forum/forum.module	12 Oct 2009 16:52:59 -0000
@@ -230,7 +230,8 @@ function forum_node_presave($node) {
   if (_forum_node_check_node_type($node)) {
     // Make sure all fields are set properly:
     $node->icon = !empty($node->icon) ? $node->icon : '';
-    $langcode = array_shift(array_keys($node->taxonomy_forums));
+    $langcodes = array_keys($node->taxonomy_forums);
+    $langcode = array_shift($langcodes);
     if (!empty($node->taxonomy_forums[$langcode])) {
       $node->forum_tid = $node->taxonomy_forums[$langcode][0]['value'];
       $old_tid = db_query_range("SELECT f.tid FROM {forum} f INNER JOIN {node} n ON f.vid = n.vid WHERE n.nid = :nid ORDER BY f.vid DESC", 0, 1, array(':nid' => $node->nid))->fetchField();
Index: modules/image/image.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.test,v
retrieving revision 1.9
diff -u -p -r1.9 image.test
--- modules/image/image.test	12 Oct 2009 05:22:57 -0000	1.9
+++ modules/image/image.test	12 Oct 2009 16:52:59 -0000
@@ -51,11 +51,13 @@ class ImageStylesPathAndUrlUnitTest exte
     image_style_save(array('name' => $this->style_name));
 
     // Create the directories for the styles.
-    $status = file_prepare_directory($d = file_directory_path() . '/styles/' . $this->style_name, FILE_CREATE_DIRECTORY);
+    $d = file_directory_path() . '/styles/' . $this->style_name;
+    $status = file_prepare_directory($d, FILE_CREATE_DIRECTORY);
     $this->assertNotIdentical(FALSE, $status, t('Created the directory for the generated images for the test style.' ));
 
     // Create a working copy of the file.
-    $file = reset($this->drupalGetTestFiles('image'));
+    $files = $this->drupalGetTestFiles('image');
+    $file = reset($files);
     $this->image_info = image_get_info($file->uri);
     $this->image_filepath = file_unmanaged_copy($file->uri, NULL, FILE_EXISTS_RENAME);
     $this->assertNotIdentical(FALSE, $this->image_filepath, t('Created the without generated image file.'));
@@ -234,7 +236,7 @@ class ImageEffectsUnitTest extends Image
  */
 class ImageAdminStylesUnitTest extends DrupalWebTestCase {
 
-  function getInfo() {
+  public static function getInfo() {
     return array(
       'name' => 'Image styles and effects UI configuration',
       'description' => 'Tests creation, deletion, and editing of image styles and effects at the UI level.',
@@ -262,7 +264,8 @@ class ImageAdminStylesUnitTest extends D
     // First, we need to make sure we have an image in our testing
     // file directory. Copy over an image on the first run.
     if (!isset($file_path)) {
-      $file = reset($this->drupalGetTestFiles('image'));
+      $files = $this->drupalGetTestFiles('image');
+      $file = reset($files);
       $file_path = file_unmanaged_copy($file->uri);
     }
 
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1145
diff -u -p -r1.1145 node.module
--- modules/node/node.module	11 Oct 2009 03:07:18 -0000	1.1145
+++ modules/node/node.module	12 Oct 2009 16:52:59 -0000
@@ -3122,7 +3122,8 @@ function node_unpublish_by_keyword_actio
  */
 function node_unpublish_by_keyword_action($node, $context) {
   foreach ($context['keywords'] as $keyword) {
-    if (strpos(drupal_render(node_build(clone $node)), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) {
+    $elements = node_build(clone $node);
+    if (strpos(drupal_render($elements), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) {
       $node->status = NODE_NOT_PUBLISHED;
       watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value']));
       break;
Index: modules/node/node.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v
retrieving revision 1.87
diff -u -p -r1.87 node.pages.inc
--- modules/node/node.pages.inc	11 Oct 2009 03:07:18 -0000	1.87
+++ modules/node/node.pages.inc	12 Oct 2009 16:53:00 -0000
@@ -385,8 +385,10 @@ function theme_node_preview($variables) 
 
   $preview_trimmed_version = FALSE;
 
-  $trimmed = drupal_render(node_build(clone $node, 'teaser'));
-  $full = drupal_render(node_build($node, 'full'));
+  $elements = node_build(clone $node, 'teaser');
+  $trimmed = drupal_render($elements);
+  $elements = node_build($node, 'full');
+  $full = drupal_render($elements);
 
   // Do we need to preview trimmed version of post as well as full version?
   if ($trimmed != $full) {
Index: modules/openid/openid.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.inc,v
retrieving revision 1.20
diff -u -p -r1.20 openid.inc
--- modules/openid/openid.inc	18 Sep 2009 00:12:47 -0000	1.20
+++ modules/openid/openid.inc	12 Oct 2009 16:53:00 -0000
@@ -73,7 +73,8 @@ function openid_redirect_http($url, $mes
  */
 function openid_redirect($url, $message) {
   $output = '<html><head><title>' . t('OpenID redirect') . "</title></head>\n<body>";
-  $output .= drupal_render(drupal_get_form('openid_redirect_form', $url, $message));
+  $elements = drupal_get_form('openid_redirect_form', $url, $message);
+  $output .= drupal_render($elements);
   $output .= '<script type="text/javascript">document.getElementById("openid-redirect-form").submit();</script>';
   $output .= "</body></html>\n";
   print $output;
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.317
diff -u -p -r1.317 poll.module
--- modules/poll/poll.module	11 Oct 2009 03:07:19 -0000	1.317
+++ modules/poll/poll.module	12 Oct 2009 16:53:00 -0000
@@ -808,7 +808,8 @@ function theme_poll_choices($variables) 
 function template_preprocess_poll_results(&$variables) {
   $variables['links'] = theme('links', array('links' => $variables['raw_links']));
   if (isset($variables['vote']) && $variables['vote'] > -1 && user_access('cancel own vote')) {
-    $variables['cancel_form'] = drupal_render(drupal_get_form('poll_cancel_form', $variables['nid']));
+    $elements = drupal_get_form('poll_cancel_form', $variables['nid']);
+    $variables['cancel_form'] = drupal_render($elements);
   }
   $variables['title'] = check_plain($variables['raw_title']);
 
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.158
diff -u -p -r1.158 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	11 Oct 2009 03:07:19 -0000	1.158
+++ modules/simpletest/drupal_web_test_case.php	12 Oct 2009 16:53:00 -0000
@@ -1101,6 +1101,7 @@ class DrupalWebTestCase extends DrupalTe
     variable_set('install_task', 'done');
     variable_set('clean_url', $clean_url_original);
     variable_set('site_mail', 'simpletest@example.com');
+    variable_set('date_default_timezone', date_default_timezone_get());
     // Set up English language.
     unset($GLOBALS['conf']['language_default']);
     $language = language_default();
Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.83
diff -u -p -r1.83 common.test
--- modules/simpletest/tests/common.test	11 Oct 2009 02:14:43 -0000	1.83
+++ modules/simpletest/tests/common.test	12 Oct 2009 16:53:01 -0000
@@ -1535,6 +1535,8 @@ class FormatDateUnitTest extends DrupalW
     $user = user_load($test_user->uid, TRUE);
     $real_language = $language->language;
     $language->language = $user->language;
+    // Simulate a Drupal bootstrap with the logged-in user.
+    date_default_timezone_set(drupal_get_user_timezone());
 
     $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', 'en'), 'Sunday, 25-Mar-07 17:00:00 PDT', t('Test a different language.'));
     $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'Europe/London'), 'Monday, 26-Mar-07 01:00:00 BST', t('Test a different time zone.'));
@@ -1547,6 +1549,8 @@ class FormatDateUnitTest extends DrupalW
     // Restore the original user and language, and enable session saving.
     $user = $real_user;
     $language->language = $real_language;
+    // Restore default time zone.
+    date_default_timezone_set(drupal_get_user_timezone());
     drupal_save_session(TRUE);
   }
 }
Index: modules/simpletest/tests/file.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file.test,v
retrieving revision 1.44
diff -u -p -r1.44 file.test
--- modules/simpletest/tests/file.test	20 Sep 2009 17:40:41 -0000	1.44
+++ modules/simpletest/tests/file.test	12 Oct 2009 16:53:02 -0000
@@ -287,17 +287,20 @@ class FileSpaceUsedTest extends FileTest
   function setUp() {
     parent::setUp();
 
-    // Create records for a couple of users with different sizes.
-    drupal_write_record('file', $file = array('uid' => 2, 'uri' => 'public://example1.txt', 'filesize' => 50, 'status' => FILE_STATUS_PERMANENT));
-    drupal_write_record('file', $file = array('uid' => 2, 'uri' => 'public://example2.txt', 'filesize' => 20, 'status' => FILE_STATUS_PERMANENT));
-    drupal_write_record('file', $file = array('uid' => 3, 'uri' => 'public://example3.txt', 'filesize' => 100, 'status' => FILE_STATUS_PERMANENT));
-    drupal_write_record('file', $file = array('uid' => 3, 'uri' => 'public://example4.txt', 'filesize' => 200, 'status' => FILE_STATUS_PERMANENT));
-
-    // Now create some with other statuses. These values were chosen arbitrarily
-    // for the sole purpose of testing that bitwise operators were used
-    // correctly on the field.
-    drupal_write_record('file', $file = array('uid' => 2, 'uri' => 'public://example5.txt', 'filesize' => 1, 'status' => 2 | 8));
-    drupal_write_record('file', $file = array('uid' => 3, 'uri' => 'public://example6.txt', 'filesize' => 3, 'status' => 2 | 4));
+    // Create records for a couple of users with different sizes and statuses.
+    // The status values were chosen arbitrarily for the sole purpose of
+    // testing that bitwise operators were used correctly on the field.
+    $files = array(
+      array('uid' => 2, 'uri' => 'public://example1.txt', 'filesize' => 50, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 2, 'uri' => 'public://example2.txt', 'filesize' => 20, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 3, 'uri' => 'public://example3.txt', 'filesize' => 100, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 3, 'uri' => 'public://example4.txt', 'filesize' => 200, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 2, 'uri' => 'public://example5.txt', 'filesize' => 1, 'status' => 2 | 8),
+      array('uid' => 3, 'uri' => 'public://example6.txt', 'filesize' => 3, 'status' => 2 | 4),
+    );
+    foreach ($files as $file) {
+      drupal_write_record('file', $file);
+    }
   }
 
   /**
@@ -1582,7 +1585,8 @@ class FileLoadTest extends FileHookTestC
    * Try to load a non-existent file by URI.
    */
   function testLoadMissingFilepath() {
-    $this->assertFalse(reset(file_load_multiple(array(), array('uri' => 'foobar://misc/druplicon.png'))), t("Try to load a file that doesn't exist in the database fails."));
+    $files = file_load_multiple(array(), array('uri' => 'foobar://misc/druplicon.png'));
+    $this->assertFalse(reset($files), t("Try to load a file that doesn't exist in the database fails."));
     $this->assertFileHooksCalled(array());
   }
 
@@ -1590,7 +1594,8 @@ class FileLoadTest extends FileHookTestC
    * Try to load a non-existent file by status.
    */
   function testLoadInvalidStatus() {
-    $this->assertFalse(reset(file_load_multiple(array(), array('status' => -99))), t("Trying to load a file with an invalid status fails."));
+    $files = file_load_multiple(array(), array('status' => -99));
+    $this->assertFalse(reset($files), t("Trying to load a file with an invalid status fails."));
     $this->assertFileHooksCalled(array());
   }
 
Index: modules/simpletest/tests/mail.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/mail.test,v
retrieving revision 1.1
diff -u -p -r1.1 mail.test
--- modules/simpletest/tests/mail.test	31 Aug 2009 18:30:26 -0000	1.1
+++ modules/simpletest/tests/mail.test	12 Oct 2009 16:53:02 -0000
@@ -13,7 +13,7 @@ class MailTestCase extends DrupalWebTest
    */
   private static $sent_message;
 
-  function getInfo() {
+  public static function getInfo() {
     return array(
       'name' => 'Mail system',
       'description' => 'Performs tests on the pluggable mailing framework.',
Index: modules/simpletest/tests/session.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/session.test,v
retrieving revision 1.18
diff -u -p -r1.18 session.test
--- modules/simpletest/tests/session.test	5 Sep 2009 13:05:30 -0000	1.18
+++ modules/simpletest/tests/session.test	12 Oct 2009 16:53:02 -0000
@@ -299,7 +299,7 @@ class SessionHttpsTestCase extends Drupa
 
     // Check that user login form action is secure.
     $this->drupalGet('user');
-    $form = &$this->xpath('//form[@id="user-login"]');
+    $form = $this->xpath('//form[@id="user-login"]');
     $this->assertEqual(substr($form[0]['action'], 0, 6), 'https:', 'Login form action is secure');
     $form[0]['action'] = $this->httpsUrl('user');
 
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.805
diff -u -p -r1.805 system.module
--- modules/system/system.module	12 Oct 2009 15:40:04 -0000	1.805
+++ modules/system/system.module	12 Oct 2009 16:53:04 -0000
@@ -1862,6 +1862,7 @@ function _system_get_module_data() {
 
   // Include the install profile in modules that are loaded.
   $profile = drupal_get_profile();
+  $modules[$profile] = (object) array();
   $modules[$profile]->name = $profile;
   $modules[$profile]->uri = 'profiles/' . $profile . '/' . $profile . '.profile';
   $modules[$profile]->filename = $profile . '.profile';
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.516
diff -u -p -r1.516 taxonomy.module
--- modules/taxonomy/taxonomy.module	10 Oct 2009 18:42:52 -0000	1.516
+++ modules/taxonomy/taxonomy.module	12 Oct 2009 16:53:04 -0000
@@ -922,7 +922,8 @@ function taxonomy_vocabulary_load_multip
  *   Results are statically cached.
  */
 function taxonomy_vocabulary_load($vid) {
-  return reset(taxonomy_vocabulary_load_multiple(array($vid)));
+  $vocabularies = taxonomy_vocabulary_load_multiple(array($vid));
+  return reset($vocabularies);
 }
 
 /**
Index: modules/taxonomy/taxonomy.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v
retrieving revision 1.49
diff -u -p -r1.49 taxonomy.test
--- modules/taxonomy/taxonomy.test	11 Oct 2009 03:07:20 -0000	1.49
+++ modules/taxonomy/taxonomy.test	12 Oct 2009 16:53:04 -0000
@@ -459,7 +459,8 @@ class TaxonomyTermTestCase extends Taxon
     // Create the term to edit.
     $this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->vid . '/list/add', $edit, t('Save'));
 
-    $term = reset(taxonomy_get_term_by_name($edit['name']));
+    $terms = taxonomy_get_term_by_name($edit['name']);
+    $term = reset($terms);
     $this->assertNotNull($term, t('Term found in database'));
 
     // Submitting a term takes us to the add page; we need the List page.
@@ -625,7 +626,8 @@ class TaxonomyHooksTestCase extends Taxo
       'antonym' => 'Long',
     );
     $this->drupalPost('admin/structure/taxonomy/' . $vocabulary->vid . '/list/add', $edit, t('Save'));
-    $term = reset(taxonomy_get_term_by_name($edit['name']));
+    $terms = taxonomy_get_term_by_name($edit['name']);
+    $term = reset($terms);
     $this->assertEqual($term->antonym, $edit['antonym'], t('Antonym was loaded into the term object'));
 
     // Update the term with a different antonym.
Index: modules/trigger/trigger.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v
retrieving revision 1.50
diff -u -p -r1.50 trigger.module
--- modules/trigger/trigger.module	10 Oct 2009 16:48:38 -0000	1.50
+++ modules/trigger/trigger.module	12 Oct 2009 16:53:04 -0000
@@ -469,7 +469,8 @@ function trigger_user_login(&$edit, $acc
  * Implement hook_user_logout().
  */
 function trigger_user_logout($account) {
-  _trigger_user('user_logout', $edit = NULL, $account);
+  $edit = NULL;
+  _trigger_user('user_logout', $edit, $account);
 }
 
 /**
@@ -509,7 +510,8 @@ function trigger_user_cancel($edit, $acc
  * Implement hook_user_view().
  */
 function trigger_user_view($account) {
-  _trigger_user('user_view', $edit = NULL, $account, NULL);
+  $edit = NULL;
+  _trigger_user('user_view', $edit, $account, NULL);
 }
 
 /**
Index: modules/upload/upload.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.test,v
retrieving revision 1.27
diff -u -p -r1.27 upload.test
--- modules/upload/upload.test	11 Oct 2009 03:07:21 -0000	1.27
+++ modules/upload/upload.test	12 Oct 2009 16:53:04 -0000
@@ -64,7 +64,8 @@ class UploadTestCase extends DrupalWebTe
 
     // Assure that the attachment link appears on teaser view and has correct count.
     $node = node_load($node->nid);
-    $teaser = drupal_render(node_build($node, 'teaser'));
+    $elements = node_build($node, 'teaser');
+    $teaser = drupal_render($elements);
     $this->assertTrue(strpos($teaser, format_plural(2, '1 attachment', '@count attachments')), 'Attachments link found on node teaser.');
 
     // Fetch db record and use fid to rename and delete file.
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1062
diff -u -p -r1.1062 user.module
--- modules/user/user.module	10 Oct 2009 21:39:03 -0000	1.1062
+++ modules/user/user.module	12 Oct 2009 16:53:04 -0000
@@ -333,6 +333,9 @@ function user_save($account, $edit = arr
 
   $edit = (array) $edit;
 
+  if (empty($account)) {
+    $account = new stdClass();
+  }
   if (!isset($account->is_new)) {
     $account->is_new = empty($account->uid);
   }
Index: modules/user/user.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.test,v
retrieving revision 1.63
diff -u -p -r1.63 user.test
--- modules/user/user.test	10 Oct 2009 16:48:39 -0000	1.63
+++ modules/user/user.test	12 Oct 2009 16:53:04 -0000
@@ -26,7 +26,8 @@ class UserRegistrationTestCase extends D
     $edit['mail'] = $mail = $edit['name'] . '@example.com';
     $this->drupalPost('user/register', $edit, t('Create new account'));
     $this->assertText(t('Your password and further instructions have been sent to your e-mail address.'), t('User registered successfully.'));
-    $new_user = reset(user_load_multiple(array(), array('name' => $name, 'mail' => $mail)));
+    $users = user_load_multiple(array(), array('name' => $name, 'mail' => $mail));
+    $new_user = reset($users);
     $this->assertTrue($new_user->status, t('New account is active after registration.'));
     
     // Allow registration by site visitors, but require administrator approval.
@@ -35,7 +36,8 @@ class UserRegistrationTestCase extends D
     $edit['name'] = $name = $this->randomName();
     $edit['mail'] = $mail = $edit['name'] . '@example.com';
     $this->drupalPost('user/register', $edit, t('Create new account'));
-    $new_user = reset(user_load_multiple(array(), array('name' => $name, 'mail' => $mail)));
+    $users = user_load_multiple(array(), array('name' => $name, 'mail' => $mail));
+    $new_user = reset($users);
     $this->assertFalse($new_user->status, t('New account is blocked until approved by an administrator.'));
   }
   
@@ -59,7 +61,8 @@ class UserRegistrationTestCase extends D
     $edit['pass[pass1]'] = $new_pass = $this->randomName();
     $edit['pass[pass2]'] = $new_pass;
     $this->drupalPost('user/register', $edit, t('Create new account'));
-    $new_user = reset(user_load_multiple(array(), array('name' => $name, 'mail' => $mail)));
+    $users = user_load_multiple(array(), array('name' => $name, 'mail' => $mail));
+    $new_user = reset($users);
     $this->assertText(t('Registration successful. You are now logged in.'), t('Users are logged in after registering.'));
     $this->drupalLogout();
     
@@ -82,7 +85,8 @@ class UserRegistrationTestCase extends D
     $this->assertText(t('The username @name has not been activated or is blocked.', array('@name' => $name)), t('User cannot login yet.'));
 
     // Activate the new account.
-    $new_user = reset(user_load_multiple(array(), array('name' => $name, 'mail' => $mail)));
+    $users = user_load_multiple(array(), array('name' => $name, 'mail' => $mail));
+    $new_user = reset($users);
     $admin_user = $this->drupalCreateUser(array('administer users'));
     $this->drupalLogin($admin_user);
     $edit = array(
@@ -115,7 +119,8 @@ class UserRegistrationTestCase extends D
     $this->drupalPost('user/register', $edit, t('Create new account'));
     
     // Check user fields.
-    $new_user = reset(user_load_multiple(array(), array('name' => $name, 'mail' => $mail)));
+    $users = user_load_multiple(array(), array('name' => $name, 'mail' => $mail));
+    $new_user = reset($users);
     $this->assertEqual($new_user->name, $name, t('Username matches.'));
     $this->assertEqual($new_user->mail, $mail, t('E-mail address matches.'));
     $this->assertEqual($new_user->theme, '', t('Correct theme field.'));
@@ -297,7 +302,7 @@ class UserLoginTestCase extends DrupalWe
   }
 }
 
-class UserCancelTestCase extends DrupalWebTestCase {
+class UserCancelTestCase extends CommentHelperCase {
   public static function getInfo() {
     return array(
       'name' => 'Cancel account',
@@ -371,7 +376,8 @@ class UserCancelTestCase extends DrupalW
     $bogus_timestamp = $timestamp - 86400 - 60;
     $this->drupalGet("user/$account->uid/cancel/confirm/$bogus_timestamp/" . user_pass_rehash($account->pass, $bogus_timestamp, $account->login));
     $this->assertText(t('You have tried to use an account cancellation link that has expired. Please request a new one using the form below.'), t('Expired cancel account request rejected.'));
-    $this->assertTrue(reset(user_load_multiple(array($account->uid), array('status' => 1))), t('User account was not canceled.'));
+    $users = user_load_multiple(array($account->uid), array('status' => 1));
+    $this->assertTrue(reset($users), t('User account was not canceled.'));
 
     // Confirm user's content has not been altered.
     $test_node = node_load($node->nid, NULL, TRUE);
@@ -525,7 +531,7 @@ class UserCancelTestCase extends DrupalW
 
     // Create comment.
     module_load_include('test', 'comment');
-    $comment = CommentHelperCase::postComment($node, '', $this->randomName(32), FALSE, TRUE);
+    $comment = $this->postComment($node, '', $this->randomName(32), FALSE, TRUE);
     $this->assertTrue(comment_load($comment->id), t('Comment found.'));
 
     // Create a node with two revisions, the initial one belonging to the
@@ -725,7 +731,8 @@ class UserPictureTestCase extends Drupal
 
         // Images are sorted first by size then by name. We need an image
         // bigger than 1 KB so we'll grab the last one.
-        $image = end($this->drupalGetTestFiles('image'));
+        $images = $this->drupalGetTestFiles('image');
+        $image = end($images);
         $info = image_get_info($image->uri);
 
         // Set new variables: valid dimensions, invalid filesize.
