? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: .htaccess
===================================================================
RCS file: /cvs/drupal/drupal/.htaccess,v
retrieving revision 1.107
diff -u -p -r1.107 .htaccess
--- .htaccess	7 Feb 2010 05:20:21 -0000	1.107
+++ .htaccess	10 Apr 2010 10:41:16 -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.361
diff -u -p -r1.361 CHANGELOG.txt
--- CHANGELOG.txt	21 Mar 2010 16:53:36 -0000	1.361
+++ CHANGELOG.txt	10 Apr 2010 10:41:16 -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: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.318
diff -u -p -r1.318 update.php
--- update.php	26 Mar 2010 22:14:46 -0000	1.318
+++ update.php	10 Apr 2010 10:41:16 -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.370
diff -u -p -r1.370 bootstrap.inc
--- includes/bootstrap.inc	7 Apr 2010 05:15:50 -0000	1.370
+++ includes/bootstrap.inc	10 Apr 2010 10:41:16 -0000
@@ -1817,6 +1817,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());
+  }
+}
+
+/**
  * Custom PHP error handler.
  *
  * @param $error_level
@@ -1910,6 +1925,7 @@ function _drupal_bootstrap_page_cache() 
     $cache = drupal_page_get_cache();
     // If there is a cached page, display it.
     if (is_object($cache)) {
+      date_default_timezone_set(drupal_get_user_timezone());
       // If the skipping of the bootstrap hooks is not enforced, call
       // hook_boot.
       if (variable_get('page_cache_invoke_hooks', TRUE)) {
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1145
diff -u -p -r1.1145 common.inc
--- includes/common.inc	7 Apr 2010 17:30:43 -0000	1.1145
+++ includes/common.inc	10 Apr 2010 10:41:17 -0000
@@ -1765,13 +1765,7 @@ function format_date($timestamp, $type =
   $timezones = &$drupal_static_fast['timezones'];
 
   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
   // constructing identical objects over the life of a request.
Index: includes/errors.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/errors.inc,v
retrieving revision 1.4
diff -u -p -r1.4 errors.inc
--- includes/errors.inc	8 Apr 2010 18:11:27 -0000	1.4
+++ includes/errors.inc	10 Apr 2010 10:41:17 -0000
@@ -201,7 +201,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';
 
Index: includes/install.core.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.core.inc,v
retrieving revision 1.7
diff -u -p -r1.7 install.core.inc
--- includes/install.core.inc	31 Mar 2010 19:10:39 -0000	1.7
+++ includes/install.core.inc	10 Apr 2010 10:41:17 -0000
@@ -1204,7 +1204,8 @@ function install_select_locale(&$install
         }
         else {
           include_once DRUPAL_ROOT . '/includes/form.inc';
-          $output = drupal_render(drupal_get_form('install_select_locale_form', $locales, $profilename));
+          $elements = drupal_get_form('install_select_locale_form', $locales, $profilename);
+          $output = drupal_render($elements);
         }
         return $output;
       }
@@ -1237,7 +1238,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, $profilename));
+        $elements = drupal_get_form('install_select_locale_form', $locales, $profilename);
+        return drupal_render($elements);
       }
       else {
         throw new Exception(st('Sorry, you must select a language to continue the installation.'));
Index: includes/session.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/session.inc,v
retrieving revision 1.80
diff -u -p -r1.80 session.inc
--- includes/session.inc	7 Apr 2010 13:49:21 -0000	1.80
+++ includes/session.inc	10 Apr 2010 10:41:17 -0000
@@ -209,6 +209,7 @@ function drupal_session_initialize() {
     $user = drupal_anonymous_user();
     session_id(md5(uniqid('', TRUE)));
   }
+  date_default_timezone_set(drupal_get_user_timezone());
 }
 
 /**
@@ -310,6 +311,7 @@ function drupal_session_regenerate() {
       ->condition('sid', $old_session_id)
       ->execute();
   }
+  date_default_timezone_set(drupal_get_user_timezone());
 }
 
 /**
Index: includes/database/select.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/select.inc,v
retrieving revision 1.34
diff -u -p -r1.34 select.inc
--- includes/database/select.inc	17 Feb 2010 05:24:53 -0000	1.34
+++ includes/database/select.inc	10 Apr 2010 10:41:17 -0000
@@ -501,11 +501,11 @@ class SelectQueryExtender implements Sel
   }
 
   public function hasAllTags() {
-    return call_user_func_array(array($this->query, 'hasAllTags', func_get_args()));
+    return call_user_func_array(array($this->query, 'hasAllTags'), func_get_args());
   }
 
   public function hasAnyTag() {
-    return call_user_func_array(array($this->query, 'hasAnyTags', func_get_args()));
+    return call_user_func_array(array($this->query, 'hasAnyTags'), func_get_args());
   }
 
   public function addMetaData($key, $object) {
Index: includes/filetransfer/filetransfer.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/filetransfer/filetransfer.inc,v
retrieving revision 1.8
diff -u -p -r1.8 filetransfer.inc
--- includes/filetransfer/filetransfer.inc	25 Jan 2010 10:38:34 -0000	1.8
+++ includes/filetransfer/filetransfer.inc	10 Apr 2010 10:41:17 -0000
@@ -24,7 +24,16 @@ abstract class FileTransfer {
     $this->jail = $jail;
   }
 
-  abstract static function factory($jail, $settings);
+  /**
+   * Classes that extend this class must override the factory() static method.
+   *
+   * @param string $jail
+   * @param array $settings
+   * @return object New instance of the appropriate FileTransfer subclass.
+   */
+  static function factory($jail, $settings) {
+    throw new FileTransferException('FileTransfer::factory() static method not overridden by FileTransfer subclass.');
+  }
 
   /**
    * Implementation of the magic __get() method.
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.537
diff -u -p -r1.537 book.module
--- modules/book/book.module	30 Jan 2010 04:23:46 -0000	1.537
+++ modules/book/book.module	10 Apr 2010 10:41:18 -0000
@@ -745,7 +745,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/color/color.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/color/color.test,v
retrieving revision 1.3
diff -u -p -r1.3 color.test
--- modules/color/color.test	3 Apr 2010 08:05:08 -0000	1.3
+++ modules/color/color.test	10 Apr 2010 10:41:18 -0000
@@ -37,9 +37,8 @@ class ColorTestCase extends DrupalWebTes
     $edit['palette[link]'] = '#123456';
     $this->drupalPost('admin/appearance/settings/garland', $edit, t('Save configuration'));
 
-    global $theme_key;
     $this->drupalGet('<front>');
-    $stylesheets = variable_get('color_' . $theme_key . '_stylesheets', array());
+    $stylesheets = variable_get('color_garland_stylesheets', array());
     $this->assertPattern('|' . file_create_url($stylesheets[0]) . '|', 'Make sure the color stylesheet is included in the content.');
 
     $stylesheet_content = join("\n", file($stylesheets[0]));
@@ -52,7 +51,7 @@ class ColorTestCase extends DrupalWebTes
     $this->drupalPost('admin/appearance/settings/garland', $edit, t('Save configuration'));
 
     $this->drupalGet('<front>');
-    $stylesheets = variable_get('color_' . $theme_key . '_stylesheets', array());
+    $stylesheets = variable_get('color_garland_stylesheets', array());
     $stylesheet_content = join("\n", file($stylesheets[0]));
     $matched = preg_match('/(.*color: #0c7a00.*)/i', $stylesheet_content, $matches);
     $this->assertTrue($matched == 1, 'Make sure the color we changed is in the color stylesheet.');
Index: modules/field/tests/field.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/tests/field.test,v
retrieving revision 1.26
diff -u -p -r1.26 field.test
--- modules/field/tests/field.test	27 Mar 2010 06:03:21 -0000	1.26
+++ modules/field/tests/field.test	10 Apr 2010 10:41:18 -0000
@@ -15,12 +15,13 @@ class FieldTestCase extends DrupalWebTes
   /**
    * Set the default field storage backend for fields created during tests.
    */
-  function setUp($modules = array()) {
+  function setUp() {
     // Since this is a base class for many test cases, support the same
     // flexibility that DrupalWebTestCase::setUp() has for the modules to be
     // passed in as either an array or a variable number of string arguments.
-    if (!is_array($modules)) {
-      $modules = func_get_args();
+    $modules = func_get_args();
+    if (isset($modules[0]) && is_array($modules[0])) {
+      $modules = $modules[0];
     }
     parent::setUp($modules);
     // Set default storage backend.
Index: modules/field_ui/field_ui.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.admin.inc,v
retrieving revision 1.47
diff -u -p -r1.47 field_ui.admin.inc
--- modules/field_ui/field_ui.admin.inc	28 Mar 2010 11:08:30 -0000	1.47
+++ modules/field_ui/field_ui.admin.inc	10 Apr 2010 10:41:18 -0000
@@ -655,6 +655,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.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v
retrieving revision 1.63
diff -u -p -r1.63 filter.test
--- modules/filter/filter.test	31 Mar 2010 20:05:06 -0000	1.63
+++ modules/filter/filter.test	10 Apr 2010 10:41:18 -0000
@@ -1169,7 +1169,8 @@ alert("test")
     $this->assertEqual($f, '&#039;', t('The @function() function correctly filters single quotes.', $replacements));
 
     // Test that the filter is not fooled by different evasion techniques.
-    $f = $function("\xc2\"");
+    // Ignore PHP 5.3+ invalid multibyte sequence warning.
+    $f = @$function("\xc2\"");
     $this->assertEqual($f, '', t('The @function() function correctly filters invalid UTF-8.', $replacements));
   }
 }
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.561
diff -u -p -r1.561 forum.module
--- modules/forum/forum.module	9 Apr 2010 12:12:30 -0000	1.561
+++ modules/forum/forum.module	10 Apr 2010 10:41:18 -0000
@@ -322,7 +322,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));
+    reset($node->taxonomy_forums);
+    $langcode = key($node->taxonomy_forums);
     if (!empty($node->taxonomy_forums[$langcode])) {
       $node->forum_tid = $node->taxonomy_forums[$langcode][0]['tid'];
       $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.17
diff -u -p -r1.17 image.test
--- modules/image/image.test	7 Apr 2010 17:24:55 -0000	1.17
+++ modules/image/image.test	10 Apr 2010 10:41:18 -0000
@@ -248,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.',
Index: modules/locale/locale.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.admin.inc,v
retrieving revision 1.9
diff -u -p -r1.9 locale.admin.inc
--- modules/locale/locale.admin.inc	9 Apr 2010 12:14:25 -0000	1.9
+++ modules/locale/locale.admin.inc	10 Apr 2010 10:41:18 -0000
@@ -783,7 +783,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;
 }
@@ -1023,9 +1024,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;
 }
 
@@ -1354,6 +1357,7 @@ function locale_date_format_form($form, 
       $choices[$f] = format_date(REQUEST_TIME, 'custom', $f);
     }
   }
+  reset($formats);
 
   // Get configured formats for each language.
   $locale_formats = system_date_format_locale($langcode);
@@ -1363,7 +1367,7 @@ function locale_date_format_form($form, 
       $default = $locale_formats[$type];
     }
     else {
-      $default = variable_get('date_format_' . $type, array_shift(array_keys($formats)));
+      $default = variable_get('date_format_' . $type, key($formats));
     }
 
     // Show date format select list.
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1257
diff -u -p -r1.1257 node.module
--- modules/node/node.module	7 Apr 2010 14:36:16 -0000	1.1257
+++ modules/node/node.module	10 Apr 2010 10:41:19 -0000
@@ -3612,7 +3612,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_view(clone $node)), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) {
+    $elements = node_view(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));
       break;
Index: modules/node/node.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v
retrieving revision 1.120
diff -u -p -r1.120 node.pages.inc
--- modules/node/node.pages.inc	31 Mar 2010 13:55:25 -0000	1.120
+++ modules/node/node.pages.inc	10 Apr 2010 10:41:19 -0000
@@ -355,8 +355,10 @@ function theme_node_preview($variables) 
 
   $preview_trimmed_version = FALSE;
 
-  $trimmed = drupal_render(node_view(clone $node, 'teaser'));
-  $full = drupal_render(node_view($node, 'full'));
+  $elements = node_view(clone $node, 'teaser');
+  $trimmed = drupal_render($elements);
+  $elements = node_view($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.29
diff -u -p -r1.29 openid.inc
--- modules/openid/openid.inc	7 Apr 2010 07:38:29 -0000	1.29
+++ modules/openid/openid.inc	10 Apr 2010 10:41:19 -0000
@@ -90,7 +90,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.340
diff -u -p -r1.340 poll.module
--- modules/poll/poll.module	6 Apr 2010 06:41:12 -0000	1.340
+++ modules/poll/poll.module	10 Apr 2010 10:41:19 -0000
@@ -842,7 +842,8 @@ function theme_poll_choices($variables) 
 function template_preprocess_poll_results(&$variables) {
   $variables['links'] = theme('links__poll_results', 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/rdf/rdf.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/rdf/rdf.test,v
retrieving revision 1.18
diff -u -p -r1.18 rdf.test
--- modules/rdf/rdf.test	8 Apr 2010 17:40:26 -0000	1.18
+++ modules/rdf/rdf.test	10 Apr 2010 10:41:19 -0000
@@ -246,7 +246,7 @@ class RdfCrudTestCase extends DrupalWebT
   }
 }
 
-class RdfMappingDefinitionTestCase extends DrupalWebTestCase {
+class RdfMappingDefinitionTestCase extends TaxonomyWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'RDF mapping definition functionality',
@@ -356,8 +356,8 @@ class RdfMappingDefinitionTestCase exten
    * Creates a random term and ensures the right RDFa markup is used.
    */
   function testTaxonomyTermRdfaAttributes() {
-    $vocabulary = TaxonomyWebTestCase::createVocabulary();
-    $term = TaxonomyWebTestCase::createTerm($vocabulary);
+    $vocabulary = $this->createVocabulary();
+    $term = $this->createTerm($vocabulary);
 
     // Views the term and checks that the RDFa markup is correct.
     $this->drupalGet('taxonomy/term/' . $term->tid);
@@ -491,7 +491,11 @@ class RdfTrackerAttributesTestCase exten
 
     // Tests that the appropriate RDFa markup to annotate the latest activity
     // date has been added to the tracker output after a comment is posted.
-    CommentHelperCase::postComment($node, $this->randomName(), $this->randomName());
+    $comment = array(
+      'subject' => $this->randomName(),
+      'comment_body[' . LANGUAGE_NONE . '][0][value]' => $this->randomName(),
+    );
+    $this->drupalPost('comment/reply/' . $node->nid, $comment, t('Save'));
     $this->drupalGet('tracker');
 
     // Tests whether the property has been set for number of comments.
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.208
diff -u -p -r1.208 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	7 Apr 2010 17:30:43 -0000	1.208
+++ modules/simpletest/drupal_web_test_case.php	10 Apr 2010 10:41:19 -0000
@@ -1100,7 +1100,7 @@ class DrupalWebTestCase extends DrupalTe
    *   List of modules to enable for the duration of the test. This can be
    *   either a single array or a variable number of string arguments.
    */
-  protected function setUp($modules = array()) {
+  protected function setUp() {
     global $db_prefix, $user, $language, $conf;
 
     // Store necessary current values before switching to prefixed database.
@@ -1164,8 +1164,9 @@ class DrupalWebTestCase extends DrupalTe
     // either a single array argument or a variable number of string arguments.
     // @todo Remove this compatibility layer in Drupal 8, and only accept
     // $modules as a single array argument.
-    if (!is_array($modules)) {
-      $modules = func_get_args();
+    $modules = func_get_args();
+    if (isset($modules[0]) && is_array($modules[0])) {
+      $modules = $modules[0];
     }
     if ($modules) {
       module_enable($modules, TRUE);
@@ -1201,6 +1202,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();
@@ -1740,7 +1742,8 @@ class DrupalWebTestCase extends DrupalTe
           $wrapperNode = $xpath->query('//*[@id="' . $ajax_settings['wrapper'] . '"]')->item(0);
           if ($wrapperNode) {
             // ajax.js adds an enclosing DIV to work around a Safari bug.
-            $newDom = DOMDocument::loadHTML('<div>' . $command['data'] . '</div>');
+            $newDom = new DOMDocument();
+            $newDom->loadHTML('<div>' . $command['data'] . '</div>');
             $newNode = $dom->importNode($newDom->documentElement->firstChild->firstChild, TRUE);
             $method = isset($command['method']) ? $command['method'] : $ajax_settings['method'];
             // The "method" is a jQuery DOM manipulation function. Emulate each
Index: modules/simpletest/tests/ajax.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/ajax.test,v
retrieving revision 1.8
diff -u -p -r1.8 ajax.test
--- modules/simpletest/tests/ajax.test	7 Apr 2010 17:30:43 -0000	1.8
+++ modules/simpletest/tests/ajax.test	10 Apr 2010 10:41:19 -0000
@@ -2,7 +2,11 @@
 // $Id: ajax.test,v 1.8 2010/04/07 17:30:43 dries Exp $
 
 class AJAXTestCase extends DrupalWebTestCase {
-  function setUp($modules = array()) {
+  function setUp() {
+    $modules = func_get_args();
+    if (isset($modules[0]) && is_array($modules[0])) {
+      $modules = $modules[0];
+    }
     parent::setUp(array_unique(array_merge(array('ajax_test', 'ajax_forms_test'), $modules)));
   }
 
@@ -26,7 +30,7 @@ class AJAXTestCase extends DrupalWebTest
  * Tests primary AJAX framework functions.
  */
 class AJAXFrameworkTestCase extends AJAXTestCase {
-  function getInfo() {
+  public static function getInfo() {
     return array(
       'name' => 'AJAX framework',
       'description' => 'Performs tests on AJAX framework functions.',
@@ -66,7 +70,7 @@ class AJAXFrameworkTestCase extends AJAX
  * Tests AJAX framework commands.
  */
 class AJAXCommandsTestCase extends AJAXTestCase {
-  function getInfo() {
+  public 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.108
diff -u -p -r1.108 common.test
--- modules/simpletest/tests/common.test	7 Apr 2010 17:30:43 -0000	1.108
+++ modules/simpletest/tests/common.test	10 Apr 2010 10:41:19 -0000
@@ -323,7 +323,8 @@ class CommonXssUnitTest extends DrupalUn
    * Check that invalid multi-byte sequences are rejected.
    */
   function testInvalidMultiByte() {
-     $text = check_plain("Foo\xC0barbaz");
+     // Ignore PHP 5.3+ invalid multibyte sequence warning.
+     $text = @check_plain("Foo\xC0barbaz");
      $this->assertEqual($text, '', 'check_plain() rejects invalid sequence "Foo\xC0barbaz"');
      $text = check_plain("Fooÿñ");
      $this->assertEqual($text, "Fooÿñ", 'check_plain() accepts valid sequence "Fooÿñ"');
@@ -1774,6 +1775,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.'));
@@ -1786,6 +1789,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.86
diff -u -p -r1.86 database_test.test
--- modules/simpletest/tests/database_test.test	28 Mar 2010 11:45:11 -0000	1.86
+++ modules/simpletest/tests/database_test.test	10 Apr 2010 10:41:20 -0000
@@ -3160,7 +3160,7 @@ class DatabaseExtraTypesTestCase extends
  * Check the sequences API.
  */
 class DatabaseNextIdCase extends DrupalWebTestCase {
-  function getInfo() {
+  public static function getInfo() {
     return array(
       'name' => t('Sequences API'),
       'description' => t('Test the secondary sequences API.'),
@@ -3187,7 +3187,7 @@ class DatabaseNextIdCase extends DrupalW
  * Tests the empty pseudo-statement class.
  */
 class DatabaseEmptyStatementTestCase extends DrupalWebTestCase {
-  function getInfo() {
+  public static function getInfo() {
     return array(
       'name' => t('Empty statement'),
       'description' => t('Test the empty pseudo-statement class.'),
Index: modules/simpletest/tests/file.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file.test,v
retrieving revision 1.51
diff -u -p -r1.51 file.test
--- modules/simpletest/tests/file.test	29 Jan 2010 22:40:41 -0000	1.51
+++ modules/simpletest/tests/file.test	10 Apr 2010 10:41:20 -0000
@@ -1946,10 +1946,13 @@ class FileDownloadTest extends FileTestC
   function testFileCreateUrl() {
     global $base_url;
 
-    $basename = " -._~!$'\"()*@[]?&+%#,;=:\n\x00" . // "Special" ASCII characters.
+    // Tilde (~) is excluded from this test because it is encoded by
+    // rawurlencode() in PHP 5.2 but not in PHP 5.3, as per RFC 3986.
+    // @see http://www.php.net/manual/en/function.rawurlencode.php#86506
+    $basename = " -._!$'\"()*@[]?&+%#,;=:\n\x00" . // "Special" ASCII characters.
       "%23%25%26%2B%2F%3F" . // Characters that look like a percent-escaped string.
       "éøïвβ中國書۞"; // Characters from various non-ASCII alphabets.
-    $basename_encoded = '%20-._%7E%21%24%27%22%28%29%2A%40%5B%5D%3F%26%2B%25%23%2C%3B%3D%3A__' .
+    $basename_encoded = '%20-._%21%24%27%22%28%29%2A%40%5B%5D%3F%26%2B%25%23%2C%3B%3D%3A__' .
       '%2523%2525%2526%252B%252F%253F' .
       '%C3%A9%C3%B8%C3%AF%D0%B2%CE%B2%E4%B8%AD%E5%9C%8B%E6%9B%B8%DB%9E';
 
Index: modules/simpletest/tests/form.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v
retrieving revision 1.46
diff -u -p -r1.46 form.test
--- modules/simpletest/tests/form.test	7 Apr 2010 17:30:43 -0000	1.46
+++ modules/simpletest/tests/form.test	10 Apr 2010 10:41:20 -0000
@@ -843,7 +843,7 @@ class FormsRebuildTestCase extends Drupa
  */
 class FormsProgrammaticTestCase extends DrupalWebTestCase {
 
-  function getInfo() {
+  public static function getInfo() {
     return array(
       'name' => 'Programmatic form submissions',
       'description' => 'Test the programmatic form submission behavior.',
@@ -908,7 +908,7 @@ class FormsProgrammaticTestCase extends 
  */
 class FormsClickedButtonTestCase extends DrupalWebTestCase {
 
-  function getInfo() {
+  public static function getInfo() {
     return array(
       'name' => 'Form clicked button determination',
       'description' => 'Test the determination of $form_state[\'clicked_button\'].',
Index: modules/simpletest/tests/form_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form_test.module,v
retrieving revision 1.35
diff -u -p -r1.35 form_test.module
--- modules/simpletest/tests/form_test.module	7 Apr 2010 17:30:43 -0000	1.35
+++ modules/simpletest/tests/form_test.module	10 Apr 2010 10:41:20 -0000
@@ -508,10 +508,10 @@ function form_test_storage_form_submit($
   $form_state['redirect'] = 'node';
 }
 
- /**
+/**
  * A form for testing form labels and required marks.
  */
-function form_label_test_form(&$form_state) {
+function form_label_test_form() {
   $form['form_checkboxes_test'] = array(
     '#type' => 'checkboxes',
     '#title' => t('Checkboxes test'),
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	10 Apr 2010 10:41:20 -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/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.265
diff -u -p -r1.265 system.admin.inc
--- modules/system/system.admin.inc	2 Apr 2010 12:53:58 -0000	1.265
+++ modules/system/system.admin.inc	10 Apr 2010 10:41:20 -0000
@@ -369,7 +369,7 @@ function system_theme_enable() {
   if (isset($_REQUEST['theme']) && isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'system-theme-operation-link')) {
     $theme = $_REQUEST['theme'];
     // Get current list of themes.
-    $themes =& _system_theme_list();
+    $themes = _system_theme_list();
 
     // Check if the specified theme is one recognized by the system.
     if (!empty($themes[$theme])) {
@@ -391,7 +391,7 @@ function system_theme_disable() {
   if (isset($_REQUEST['theme']) && isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'system-theme-operation-link')) {
     $theme = $_REQUEST['theme'];
     // Get current list of themes.
-    $themes =& _system_theme_list();
+    $themes = _system_theme_list();
 
     // Check if the specified theme is one recognized by the system.
     if (!empty($themes[$theme])) {
@@ -419,7 +419,7 @@ function system_theme_default() {
   if (isset($_REQUEST['theme']) && isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'system-theme-operation-link')) {
     $theme = $_REQUEST['theme'];
     // Get current list of themes.
-    $themes =& _system_theme_list();
+    $themes = _system_theme_list();
 
     // Check if the specified theme is one recognized by the system.
     if (!empty($themes[$theme])) {
@@ -1947,7 +1947,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)));
+      reset($formats);
+      $default = variable_get('date_format_' . $type, key($formats));
 
       // Get date type info for this date type.
       $type_info = system_get_date_types($type);
Index: modules/trigger/trigger.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v
retrieving revision 1.61
diff -u -p -r1.61 trigger.module
--- modules/trigger/trigger.module	26 Mar 2010 20:44:10 -0000	1.61
+++ modules/trigger/trigger.module	10 Apr 2010 10:41:20 -0000
@@ -488,7 +488,8 @@ function trigger_user_login(&$edit, $acc
  * Implements hook_user_logout().
  */
 function trigger_user_logout($account) {
-  _trigger_user('user_logout', $edit = NULL, $account);
+  $edit = NULL;
+  _trigger_user('user_logout', $edit, $account);
 }
 
 /**
@@ -534,7 +535,8 @@ function trigger_user_delete($account) {
  * Implements 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/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1154
diff -u -p -r1.1154 user.module
--- modules/user/user.module	7 Apr 2010 16:35:03 -0000	1.1154
+++ modules/user/user.module	10 Apr 2010 10:41:21 -0000
@@ -370,6 +370,9 @@ function user_save($account, $edit = arr
     field_attach_presave('user', $edit);
     $edit = (array) $edit;
 
+    if (empty($account)) {
+      $account = new stdClass();
+    }
     if (!isset($account->is_new)) {
       $account->is_new = empty($account->uid);
     }
