? 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 Nov 2009 06:47:01 -0000
@@ -38,6 +38,8 @@ DirectoryIndex index.php index.html inde
   php_value mbstring.http_input             pass
   php_value mbstring.http_output            pass
   php_flag mbstring.encoding_translation    off
+  # Report all PHP errors, including compile-time errors.
+  php_value error_reporting                 -1
 </IfModule>
 
 # Requires mod_expires to be enabled.
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal/drupal/CHANGELOG.txt,v
retrieving revision 1.350
diff -u -p -r1.350 CHANGELOG.txt
--- CHANGELOG.txt	10 Nov 2009 17:27:53 -0000	1.350
+++ CHANGELOG.txt	12 Nov 2009 06:47:01 -0000
@@ -84,6 +84,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.221
diff -u -p -r1.221 install.php
--- install.php	4 Nov 2009 04:56:54 -0000	1.221
+++ install.php	12 Nov 2009 06:47:01 -0000
@@ -1213,7 +1213,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.310
diff -u -p -r1.310 update.php
--- update.php	4 Nov 2009 05:39:14 -0000	1.310
+++ update.php	12 Nov 2009 06:47:01 -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.325
diff -u -p -r1.325 bootstrap.inc
--- includes/bootstrap.inc	10 Nov 2009 22:06:09 -0000	1.325
+++ includes/bootstrap.inc	12 Nov 2009 06:47:01 -0000
@@ -484,9 +484,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.
@@ -1532,6 +1529,21 @@ function drupal_bootstrap($phase = NULL,
 }
 
 /**
+ * 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());
+  }
+}
+
+/**
  * Bootstrap configuration: Setup script environment and load settings.php.
  */
 function _drupal_bootstrap_configuration() {
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1045
diff -u -p -r1.1045 common.inc
--- includes/common.inc	11 Nov 2009 00:48:56 -0000	1.1045
+++ includes/common.inc	12 Nov 2009 06:47:02 -0000
@@ -1198,7 +1198,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';
 
@@ -2277,13 +2277,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.234
diff -u -p -r1.234 locale.inc
--- includes/locale.inc	3 Nov 2009 05:27:18 -0000	1.234
+++ includes/locale.inc	12 Nov 2009 06:47:02 -0000
@@ -1059,7 +1059,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;
 }
@@ -1298,9 +1299,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.73
diff -u -p -r1.73 session.inc
--- includes/session.inc	4 Nov 2009 05:05:52 -0000	1.73
+++ includes/session.inc	12 Nov 2009 06:47:02 -0000
@@ -207,6 +207,7 @@ function drupal_session_initialize() {
     $user = drupal_anonymous_user();
     session_id(md5(uniqid('', TRUE)));
   }
+  date_default_timezone_set(drupal_get_user_timezone());
 }
 
 /**
@@ -307,6 +308,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.6
diff -u -p -r1.6 filetransfer.inc
--- includes/filetransfer/filetransfer.inc	24 Oct 2009 05:38:27 -0000	1.6
+++ includes/filetransfer/filetransfer.inc	12 Nov 2009 06:47:02 -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.524
diff -u -p -r1.524 book.module
--- modules/book/book.module	8 Nov 2009 10:02:41 -0000	1.524
+++ modules/book/book.module	12 Nov 2009 06:47:03 -0000
@@ -710,7 +710,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.66
diff -u -p -r1.66 field.test
--- modules/field/field.test	8 Nov 2009 19:53:19 -0000	1.66
+++ modules/field/field.test	12 Nov 2009 06:47:03 -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/field_ui/field_ui.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.admin.inc,v
retrieving revision 1.29
diff -u -p -r1.29 field_ui.admin.inc
--- modules/field_ui/field_ui.admin.inc	11 Nov 2009 06:58:24 -0000	1.29
+++ modules/field_ui/field_ui.admin.inc	12 Nov 2009 06:47:03 -0000
@@ -653,6 +653,7 @@ function template_preprocess_field_ui_di
     $row = new stdClass();
     foreach (element_children($element) as $child) {
       if (array_key_exists('label', $element[$child])) {
+        $row->{$child} = new stdClass();
         $row->{$child}->label = drupal_render($element[$child]['label']);
         $row->{$child}->type = drupal_render($element[$child]['type']);
       }
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.300
diff -u -p -r1.300 filter.module
--- modules/filter/filter.module	23 Oct 2009 22:24:14 -0000	1.300
+++ modules/filter/filter.module	12 Nov 2009 06:47:03 -0000
@@ -435,7 +435,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.532
diff -u -p -r1.532 forum.module
--- modules/forum/forum.module	8 Nov 2009 19:11:56 -0000	1.532
+++ modules/forum/forum.module	12 Nov 2009 06:47:03 -0000
@@ -228,7 +228,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.12
diff -u -p -r1.12 image.test
--- modules/image/image.test	10 Nov 2009 17:27:53 -0000	1.12
+++ modules/image/image.test	12 Nov 2009 06:47:03 -0000
@@ -84,14 +84,17 @@ class ImageStylesPathAndUrlUnitTest exte
     // Make the default scheme neither "public" nor "private" to verify the
     // functions work for other than the default scheme.
     variable_set('file_default_scheme', 'temporary');
-    file_prepare_directory($d = 'temporary://', FILE_CREATE_DIRECTORY);
+    $directory = 'temporary://';
+    file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
 
     // Create the directories for the styles.
-    $status = file_prepare_directory($d = $scheme . '://styles/' . $this->style_name, FILE_CREATE_DIRECTORY);
+    $directory = $scheme . '://styles/' . $this->style_name;
+    $status = file_prepare_directory($directory, 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);
     $image_info = image_get_info($file->uri);
     $original_uri = file_unmanaged_copy($file->uri, $scheme . '://', FILE_EXISTS_RENAME);
     $this->assertNotIdentical(FALSE, $original_uri, t('Created the generated image file.'));
@@ -245,7 +248,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.',
@@ -273,7 +276,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/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.268
diff -u -p -r1.268 locale.module
--- modules/locale/locale.module	10 Nov 2009 17:27:53 -0000	1.268
+++ modules/locale/locale.module	12 Nov 2009 06:47:03 -0000
@@ -1000,7 +1000,8 @@ function locale_date_format_form($form, 
       $default = $locale_formats[$type];
     }
     else {
-      $default = variable_get('date_format_' . $type, array_shift(array_keys($formats)));
+      $formats = array_keys($formats);
+      $default = variable_get('date_format_' . $type, array_shift($formats));
     }
 
     // Show date format select list.
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1166
diff -u -p -r1.1166 node.module
--- modules/node/node.module	8 Nov 2009 10:02:41 -0000	1.1166
+++ modules/node/node.module	12 Nov 2009 06:47:04 -0000
@@ -3162,7 +3162,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.100
diff -u -p -r1.100 node.pages.inc
--- modules/node/node.pages.inc	8 Nov 2009 10:02:41 -0000	1.100
+++ modules/node/node.pages.inc	12 Nov 2009 06:47:04 -0000
@@ -393,8 +393,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.21
diff -u -p -r1.21 openid.inc
--- modules/openid/openid.inc	13 Oct 2009 21:16:43 -0000	1.21
+++ modules/openid/openid.inc	12 Nov 2009 06:47:04 -0000
@@ -70,7 +70,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.323
diff -u -p -r1.323 poll.module
--- modules/poll/poll.module	8 Nov 2009 10:02:41 -0000	1.323
+++ modules/poll/poll.module	12 Nov 2009 06:47:04 -0000
@@ -811,7 +811,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.169
diff -u -p -r1.169 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	10 Nov 2009 22:06:09 -0000	1.169
+++ modules/simpletest/drupal_web_test_case.php	12 Nov 2009 06:47:04 -0000
@@ -1102,6 +1102,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/ajax.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/ajax.test,v
retrieving revision 1.1
diff -u -p -r1.1 ajax.test
--- modules/simpletest/tests/ajax.test	18 Oct 2009 05:14:39 -0000	1.1
+++ modules/simpletest/tests/ajax.test	12 Nov 2009 06:47:04 -0000
@@ -16,7 +16,7 @@ class AJAXTestCase extends DrupalWebTest
  * Tests primary AJAX framework functions.
  */
 class AJAXFrameworkTestCase extends AJAXTestCase {
-  function getInfo() {
+  static function getInfo() {
     return array(
       'name' => 'AJAX framework',
       'description' => 'Performs tests on AJAX framework functions.',
@@ -56,7 +56,7 @@ class AJAXFrameworkTestCase extends AJAX
  * Tests AJAX framework commands.
  */
 class AJAXCommandsTestCase extends AJAXTestCase {
-  function getInfo() {
+  static function getInfo() {
     return array(
       'name' => 'AJAX commands',
       'description' => 'Performs tests on AJAX framework commands.',
Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.90
diff -u -p -r1.90 common.test
--- modules/simpletest/tests/common.test	11 Nov 2009 00:48:56 -0000	1.90
+++ modules/simpletest/tests/common.test	12 Nov 2009 06:47:04 -0000
@@ -1668,6 +1668,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.'));
@@ -1680,6 +1682,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/database_test.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/database_test.test,v
retrieving revision 1.72
diff -u -p -r1.72 database_test.test
--- modules/simpletest/tests/database_test.test	26 Oct 2009 04:46:38 -0000	1.72
+++ modules/simpletest/tests/database_test.test	12 Nov 2009 06:47:05 -0000
@@ -3001,7 +3001,7 @@ class DatabaseExtraTypesTestCase extends
  * Check the sequences API.
  */
 class DatabaseNextIdCase extends DrupalWebTestCase {
-  function getInfo() {
+  static function getInfo() {
     return array(
       'name' => t('Sequences API'),
       'description' => t('Test the secondary sequences API.'),
Index: modules/simpletest/tests/file.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file.test,v
retrieving revision 1.46
diff -u -p -r1.46 file.test
--- modules/simpletest/tests/file.test	10 Nov 2009 17:27:53 -0000	1.46
+++ modules/simpletest/tests/file.test	12 Nov 2009 06:47:05 -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.2
diff -u -p -r1.2 mail.test
--- modules/simpletest/tests/mail.test	16 Oct 2009 03:01:54 -0000	1.2
+++ modules/simpletest/tests/mail.test	12 Nov 2009 06:47:05 -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.19
diff -u -p -r1.19 session.test
--- modules/simpletest/tests/session.test	4 Nov 2009 05:05:52 -0000	1.19
+++ modules/simpletest/tests/session.test	12 Nov 2009 06:47:05 -0000
@@ -343,7 +343,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.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.221
diff -u -p -r1.221 system.admin.inc
--- modules/system/system.admin.inc	11 Nov 2009 17:14:59 -0000	1.221
+++ modules/system/system.admin.inc	12 Nov 2009 06:47:05 -0000
@@ -1742,7 +1742,8 @@ function system_date_time_settings() {
       foreach ($formats as $f => $format) {
         $choices[$f] = format_date(REQUEST_TIME, 'custom', $f);
       }
-      $default = variable_get('date_format_' . $type, array_shift(array_keys($formats)));
+      $formats = array_keys($formats);
+      $default = variable_get('date_format_' . $type, array_shift($formats));
 
       // Get date type info for this date type.
       $type_info = system_get_date_types($type);
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.840
diff -u -p -r1.840 system.module
--- modules/system/system.module	11 Nov 2009 17:14:59 -0000	1.840
+++ modules/system/system.module	12 Nov 2009 06:47:05 -0000
@@ -2101,6 +2101,7 @@ function _system_rebuild_module_data() {
 
   // Include the install profile in modules that are loaded.
   $profile = drupal_get_profile();
+  $modules[$profile] = new stdClass();
   $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.537
diff -u -p -r1.537 taxonomy.module
--- modules/taxonomy/taxonomy.module	11 Nov 2009 17:10:49 -0000	1.537
+++ modules/taxonomy/taxonomy.module	12 Nov 2009 06:47:06 -0000
@@ -847,7 +847,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.58
diff -u -p -r1.58 taxonomy.test
--- modules/taxonomy/taxonomy.test	11 Nov 2009 17:10:49 -0000	1.58
+++ modules/taxonomy/taxonomy.test	12 Nov 2009 06:47:06 -0000
@@ -441,7 +441,8 @@ class TaxonomyTermTestCase extends Taxon
     // Create the term to edit.
     $this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->vid . '/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.
@@ -670,7 +671,8 @@ class TaxonomyHooksTestCase extends Taxo
       'antonym' => 'Long',
     );
     $this->drupalPost('admin/structure/taxonomy/' . $vocabulary->vid . '/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.54
diff -u -p -r1.54 trigger.module
--- modules/trigger/trigger.module	8 Nov 2009 10:02:41 -0000	1.54
+++ modules/trigger/trigger.module	12 Nov 2009 06:47:06 -0000
@@ -478,7 +478,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);
 }
 
 /**
@@ -518,7 +519,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.29
diff -u -p -r1.29 upload.test
--- modules/upload/upload.test	8 Nov 2009 10:02:41 -0000	1.29
+++ modules/upload/upload.test	12 Nov 2009 06:47:06 -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.1077
diff -u -p -r1.1077 user.module
--- modules/user/user.module	7 Nov 2009 14:27:20 -0000	1.1077
+++ modules/user/user.module	12 Nov 2009 06:47:06 -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.67
diff -u -p -r1.67 user.test
--- modules/user/user.test	10 Nov 2009 17:27:54 -0000	1.67
+++ modules/user/user.test	12 Nov 2009 06:47:06 -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), '', TRUE);
+    $comment = $this->postComment($node, $this->randomName(32), '', 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.
