commit 6ff32ceafeb1030d639d68b251357145f78b0409
Author: Florent Torregrosa <florent.torregrosa@centrale-marseille.fr>
Date:   Fri Apr 3 10:41:10 2015 +0200

    Update core to 7.36

diff --git a/drupal7/CHANGELOG.txt b/drupal7/CHANGELOG.txt
index e6ede755..039ab82a 100644
--- a/drupal7/CHANGELOG.txt
+++ b/drupal7/CHANGELOG.txt
@@ -1,4 +1,62 @@
 
+Drupal 7.36, 2015-04-01
+-----------------------
+- Added a 'file_public_schema' variable which allows modules that define
+  publicly-accessible streams in hook_stream_wrappers() to bypass file download
+  access checks when processing managed file upload fields.
+- Fixed a bug that caused database query tags not to be added to search-related
+  database queries under many circumstances, and which prevented the
+  corresponding hook_query_TAG_alter() implementations from being called.
+- Fixed the "for" attribute on managed file upload field labels to improve
+  accessibility (minor markup change).
+- Added a 'javascript_always_use_jquery' variable which can be set to FALSE by
+  sites that may not need jQuery loaded on all pages, and a 'requires_jquery'
+  option to drupal_add_js() which modules can set to FALSE when adding
+  JavaScript files that have no dependency on jQuery (API addition:
+  https://www.drupal.org/node/2462717).
+- Fixed incorrect foreign keys in the User module's role_permission and
+  users_roles database tables.
+- Changed permission descriptions throughout Drupal core to consistently link
+  to relevant administrative pages, regardless of whether the user viewing the
+  Permissions page can view the page being linked to (minor UI change).
+- Fixed the drupal_add_region_content() function so that it actually adds
+  content to the page.
+- Added an 'image_suppress_itok_output' variable to allow sites already using
+  the existing 'image_allow_insecure_derivatives' variable to also prevent
+  security tokens from appearing in image derivative URLs.
+- Fixed double-escaping of theme names in the Block module administrative
+  interface (minor string change).
+- Added basic support for Xdebug when running automated tests.
+- Fixed a bug which caused previewing a node to remove elements from the node
+  being edited. With this fix, calling node_preview() will no longer modify the
+  passed-in node object (minor API change).
+- Added a user_has_role() function to check whether a user has a particular
+  role (API addition: https://www.drupal.org/node/2462411).
+- Fixed installation failures when an opcode cache is enabled.
+- Fixed a bug in the Drupal 6 to Drupal 7 upgrade path which caused private
+  files to be inaccessible.
+- Fixed a bug in the Drupal 6 to Drupal 7 upgrade path which caused user
+  pictures to be lost.
+- Fixed missing language code in hook_field_attach_view_alter() when it is
+  invoked from field_view_field().
+- Stopped sending ETag and Last-Modified headers for uncached page requests,
+  since they break caching for certain Varnish and Nginx configurations.
+- Changed the Simpletest module to allow PSR-4 test classes to be used in
+  Drupal 7.
+- Fixed a fatal error that occurred when using the Comment module's "Unpublish
+  comment containing keyword(s)" action.
+- Changed the "lang" attribute on language links to "xml:lang" so it validates
+  as XHTML (minor markup change).
+- Prevented the form API from allowing arrays to be submitted for various form
+  elements, such as textfields, textareas, and password fields (API change:
+  https://www.drupal.org/node/2462723).
+- Fixed a bug in the Contact module which caused the global user object to have
+  the incorrect name and e-mail address during the remainder of the page
+  request after the contact form is submitted.
+- Numerous small bug fixes.
+- Numerous API documentation improvements.
+- Additional automated test coverage.
+
 Drupal 7.35, 2015-03-18
 ----------------------
 - Fixed security issues (multiple vulnerabilities). See SA-CORE-2015-001.
diff --git a/drupal7/MAINTAINERS.txt b/drupal7/MAINTAINERS.txt
index 36563145..f5cf6f89 100644
--- a/drupal7/MAINTAINERS.txt
+++ b/drupal7/MAINTAINERS.txt
@@ -27,7 +27,6 @@ Ajax system
 - Earl Miles 'merlinofchaos' http://drupal.org/user/26979
 
 Base system
-- Károly Négyesi 'chx' http://drupal.org/user/9446
 - Damien Tournoud 'DamZ' http://drupal.org/user/22211
 - Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23
 
@@ -39,7 +38,6 @@ Cache system
 - Nathaniel Catchpole 'catch' http://drupal.org/user/35733
 
 Cron system
-- Károly Négyesi 'chx' http://drupal.org/user/9446
 - Derek Wright 'dww' http://drupal.org/user/46549
 
 Database system
@@ -55,10 +53,8 @@ Database system
 
   - Sqlite driver
     - Damien Tournoud 'DamZ' http://drupal.org/user/22211
-    - Károly Négyesi 'chx' http://drupal.org/user/9446
 
 Database update system
-- Károly Négyesi 'chx' http://drupal.org/user/9446
 - Ashok Modi 'BTMash' http://drupal.org/user/60422
 
 Entity system
@@ -71,7 +67,6 @@ File system
 - Aaron Winborn 'aaron' http://drupal.org/user/33420
 
 Form system
-- Károly Négyesi 'chx' http://drupal.org/user/9446
 - Alex Bronstein 'effulgentsia' http://drupal.org/user/78040
 - Wolfgang Ziegler 'fago' http://drupal.org/user/16747
 - Daniel F. Kudwien 'sun' http://drupal.org/user/54136
@@ -105,7 +100,6 @@ Markup
 
 Menu system
 - Peter Wolanin 'pwolanin' http://drupal.org/user/49851
-- Károly Négyesi 'chx' http://drupal.org/user/9446
 
 Path system
 - Dave Reid 'davereid' http://drupal.org/user/53892
@@ -261,7 +255,6 @@ Shortcut module
 
 Simpletest module
 - Jimmy Berry 'boombatower' http://drupal.org/user/214218
-- Károly Négyesi 'chx' http://drupal.org/user/9446
 
 Statistics module
 - Tim Millwood 'timmillwood' http://drupal.org/user/227849
diff --git a/drupal7/includes/ajax.inc b/drupal7/includes/ajax.inc
index 10877a24..6e8e277b 100644
--- a/drupal7/includes/ajax.inc
+++ b/drupal7/includes/ajax.inc
@@ -211,7 +211,7 @@
  *
  * When returning an Ajax command array, it is often useful to have
  * status messages rendered along with other tasks in the command array.
- * In that case the the Ajax commands array may be constructed like this:
+ * In that case the Ajax commands array may be constructed like this:
  * @code
  *   $commands = array();
  *   $commands[] = ajax_command_replace(NULL, $output);
diff --git a/drupal7/includes/bootstrap.inc b/drupal7/includes/bootstrap.inc
index b33f950f..b9d49de9 100644
--- a/drupal7/includes/bootstrap.inc
+++ b/drupal7/includes/bootstrap.inc
@@ -8,7 +8,7 @@
 /**
  * The current system version.
  */
-define('VERSION', '7.35');
+define('VERSION', '7.36');
 
 /**
  * Core API compatibility.
@@ -529,9 +529,8 @@ function timer_stop($name) {
  * Returns the appropriate configuration directory.
  *
  * Returns the configuration path based on the site's hostname, port, and
- * pathname. Uses find_conf_path() to find the current configuration directory.
- * See default.settings.php for examples on how the URL is converted to a
- * directory.
+ * pathname. See default.settings.php for examples on how the URL is converted
+ * to a directory.
  *
  * @param bool $require_settings
  *   Only configuration directories with an existing settings.php file
@@ -1246,23 +1245,10 @@ function drupal_send_headers($default_headers = array(), $only_default = FALSE)
  * fresh page on every request. This prevents authenticated users from seeing
  * locally cached pages.
  *
- * Also give each page a unique ETag. This will force clients to include both
- * an If-Modified-Since header and an If-None-Match header when doing
- * conditional requests for the page (required by RFC 2616, section 13.3.4),
- * making the validation more robust. This is a workaround for a bug in Mozilla
- * Firefox that is triggered when Drupal's caching is enabled and the user
- * accesses Drupal via an HTTP proxy (see
- * https://bugzilla.mozilla.org/show_bug.cgi?id=269303): When an authenticated
- * user requests a page, and then logs out and requests the same page again,
- * Firefox may send a conditional request based on the page that was cached
- * locally when the user was logged in. If this page did not have an ETag
- * header, the request only contains an If-Modified-Since header. The date will
- * be recent, because with authenticated users the Last-Modified header always
- * refers to the time of the request. If the user accesses Drupal via a proxy
- * server, and the proxy already has a cached copy of the anonymous page with an
- * older Last-Modified date, the proxy may respond with 304 Not Modified, making
- * the client think that the anonymous and authenticated pageviews are
- * identical.
+ * ETag and Last-Modified headers are not set per default for authenticated
+ * users so that browsers do not send If-Modified-Since headers from
+ * authenticated user pages. drupal_serve_page_from_cache() will set appropriate
+ * ETag and Last-Modified headers for cached pages.
  *
  * @see drupal_page_set_cache()
  */
@@ -1275,9 +1261,7 @@ function drupal_page_header() {
 
   $default_headers = array(
     'Expires' => 'Sun, 19 Nov 1978 05:00:00 GMT',
-    'Last-Modified' => gmdate(DATE_RFC7231, REQUEST_TIME),
     'Cache-Control' => 'no-cache, must-revalidate, post-check=0, pre-check=0',
-    'ETag' => '"' . REQUEST_TIME . '"',
   );
   drupal_send_headers($default_headers);
 }
@@ -1659,14 +1643,14 @@ function request_uri() {
  *   information about the passed-in exception is used.
  * @param $variables
  *   Array of variables to replace in the message on display. Defaults to the
- *   return value of drupal_decode_exception().
+ *   return value of _drupal_decode_exception().
  * @param $severity
  *   The severity of the message, as per RFC 3164.
  * @param $link
  *   A link to associate with the message.
  *
  * @see watchdog()
- * @see drupal_decode_exception()
+ * @see _drupal_decode_exception()
  */
 function watchdog_exception($type, Exception $exception, $message = NULL, $variables = array(), $severity = WATCHDOG_ERROR, $link = NULL) {
 
@@ -2653,7 +2637,7 @@ function drupal_installation_attempted() {
  *
  * This would include implementations of hook_install(), which could run
  * during the Drupal installation phase, and might also be run during
- * non-installation time, such as while installing the module from the the
+ * non-installation time, such as while installing the module from the
  * module administration page.
  *
  * Example usage:
@@ -3182,10 +3166,13 @@ function _registry_check_code($type, $name = NULL) {
   // This function may get called when the default database is not active, but
   // there is no reason we'd ever want to not use the default database for
   // this query.
-  $file = Database::getConnection('default', 'default')->query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array(
-      ':name' => $name,
-      ':type' => $type,
-    ))
+  $file = Database::getConnection('default', 'default')
+    ->select('registry', 'r', array('target' => 'default'))
+    ->fields('r', array('filename'))
+    // Use LIKE here to make the query case-insensitive.
+    ->condition('r.name', db_like($name), 'LIKE')
+    ->condition('r.type', $type)
+    ->execute()
     ->fetchField();
 
   // Flag that we've run a lookup query and need to update the cache.
@@ -3523,3 +3510,34 @@ function drupal_check_memory_limit($required, $memory_limit = NULL) {
   // - The memory limit is greater than the memory required for the operation.
   return ((!$memory_limit) || ($memory_limit == -1) || (parse_size($memory_limit) >= parse_size($required)));
 }
+
+/**
+ * Invalidates a PHP file from any active opcode caches.
+ *
+ * If the opcode cache does not support the invalidation of individual files,
+ * the entire cache will be flushed.
+ *
+ * @param string $filepath
+ *   The absolute path of the PHP file to invalidate.
+ */
+function drupal_clear_opcode_cache($filepath) {
+  if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) {
+    // Below PHP 5.3, clearstatcache does not accept any function parameters.
+    clearstatcache();
+  }
+  else {
+    clearstatcache(TRUE, $filepath);
+  }
+
+  // Zend OPcache.
+  if (function_exists('opcache_invalidate')) {
+    opcache_invalidate($filepath, TRUE);
+  }
+  // APC.
+  if (function_exists('apc_delete_file')) {
+    // apc_delete_file() throws a PHP warning in case the specified file was
+    // not compiled yet.
+    // @see http://php.net/apc-delete-file
+    @apc_delete_file($filepath);
+  }
+}
diff --git a/drupal7/includes/common.inc b/drupal7/includes/common.inc
index ad2a3454..0437ec1a 100644
--- a/drupal7/includes/common.inc
+++ b/drupal7/includes/common.inc
@@ -4162,6 +4162,13 @@ function drupal_region_class($region) {
  *       else being the same, JavaScript added by a call to drupal_add_js() that
  *       happened later in the page request gets added to the page after one for
  *       which drupal_add_js() happened earlier in the page request.
+ *   - requires_jquery: Set this to FALSE if the JavaScript you are adding does
+ *     not have a dependency on jQuery. Defaults to TRUE, except for JavaScript
+ *     settings where it defaults to FALSE. This is used on sites that have the
+ *     'javascript_always_use_jquery' variable set to FALSE; on those sites, if
+ *     all the JavaScript added to the page by drupal_add_js() does not have a
+ *     dependency on jQuery, then for improved front-end performance Drupal
+ *     will not add jQuery and related libraries and settings to the page.
  *   - defer: If set to TRUE, the defer attribute is set on the <script>
  *     tag. Defaults to FALSE.
  *   - cache: If set to FALSE, the JavaScript file is loaded anew on every page
@@ -4179,6 +4186,14 @@ function drupal_region_class($region) {
  */
 function drupal_add_js($data = NULL, $options = NULL) {
   $javascript = &drupal_static(__FUNCTION__, array());
+  $jquery_added = &drupal_static(__FUNCTION__ . ':jquery_added', FALSE);
+
+  // If the $javascript variable has been reset with drupal_static_reset(),
+  // jQuery and related files will have been removed from the list, so set the
+  // variable back to FALSE to indicate they have not yet been added.
+  if (empty($javascript)) {
+    $jquery_added = FALSE;
+  }
 
   // Construct the options, taking the defaults into consideration.
   if (isset($options)) {
@@ -4189,6 +4204,9 @@ function drupal_add_js($data = NULL, $options = NULL) {
   else {
     $options = array();
   }
+  if (isset($options['type']) && $options['type'] == 'setting') {
+    $options += array('requires_jquery' => FALSE);
+  }
   $options += drupal_js_defaults($data);
 
   // Preprocess can only be set if caching is enabled.
@@ -4199,14 +4217,18 @@ function drupal_add_js($data = NULL, $options = NULL) {
   $options['weight'] += count($javascript) / 1000;
 
   if (isset($data)) {
-    // Add jquery.js and drupal.js, as well as the basePath setting, the
-    // first time a JavaScript file is added.
-    if (empty($javascript)) {
+    // Add jquery.js, drupal.js, and related files and settings if they have
+    // not been added yet. However, if the 'javascript_always_use_jquery'
+    // variable is set to FALSE (indicating that the site does not want jQuery
+    // automatically added on all pages) then only add it if a file or setting
+    // that requires jQuery is being added also.
+    if (!$jquery_added && (variable_get('javascript_always_use_jquery', TRUE) || $options['requires_jquery'])) {
+      $jquery_added = TRUE;
       // url() generates the prefix using hook_url_outbound_alter(). Instead of
       // running the hook_url_outbound_alter() again here, extract the prefix
       // from url().
       url('', array('prefix' => &$prefix));
-      $javascript = array(
+      $default_javascript = array(
         'settings' => array(
           'data' => array(
             array('basePath' => base_path()),
@@ -4225,11 +4247,13 @@ function drupal_add_js($data = NULL, $options = NULL) {
           'group' => JS_LIBRARY,
           'every_page' => TRUE,
           'weight' => -1,
+          'requires_jquery' => TRUE,
           'preprocess' => TRUE,
           'cache' => TRUE,
           'defer' => FALSE,
         ),
       );
+      $javascript = drupal_array_merge_deep($javascript, $default_javascript);
       // Register all required libraries.
       drupal_add_library('system', 'jquery', TRUE);
       drupal_add_library('system', 'jquery.once', TRUE);
@@ -4270,6 +4294,7 @@ function drupal_js_defaults($data = NULL) {
     'group' => JS_DEFAULT,
     'every_page' => FALSE,
     'weight' => 0,
+    'requires_jquery' => TRUE,
     'scope' => 'header',
     'cache' => TRUE,
     'defer' => FALSE,
@@ -4316,7 +4341,12 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
   if (!isset($javascript)) {
     $javascript = drupal_add_js();
   }
-  if (empty($javascript)) {
+
+  // If no JavaScript items have been added, or if the only JavaScript items
+  // that have been added are JavaScript settings (which don't do anything
+  // without any JavaScript code to use them), then no JavaScript code should
+  // be added to the page.
+  if (empty($javascript) || (isset($javascript['settings']) && count($javascript) == 1)) {
     return '';
   }
 
@@ -4470,8 +4500,8 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
  *
  * Libraries, JavaScript, CSS and other types of custom structures are attached
  * to elements using the #attached property. The #attached property is an
- * associative array, where the keys are the the attachment types and the values
- * are the attached data. For example:
+ * associative array, where the keys are the attachment types and the values are
+ * the attached data. For example:
  * @code
  * $build['#attached'] = array(
  *   'js' => array(drupal_get_path('module', 'taxonomy') . '/taxonomy.js'),
diff --git a/drupal7/includes/database/mysql/database.inc b/drupal7/includes/database/mysql/database.inc
index 4907a39d..0b84f271 100644
--- a/drupal7/includes/database/mysql/database.inc
+++ b/drupal7/includes/database/mysql/database.inc
@@ -36,6 +36,10 @@ class DatabaseConnection_mysql extends DatabaseConnection {
       // Default to TCP connection on port 3306.
       $dsn = 'mysql:host=' . $connection_options['host'] . ';port=' . (empty($connection_options['port']) ? 3306 : $connection_options['port']);
     }
+    // Character set is added to dsn to ensure PDO uses the proper character
+    // set when escaping. This has security implications. See
+    // https://www.drupal.org/node/1201452 for further discussion.
+    $dsn .= ';charset=utf8';
     $dsn .= ';dbname=' . $connection_options['database'];
     // Allow PDO options to be overridden.
     $connection_options += array(
diff --git a/drupal7/includes/database/query.inc b/drupal7/includes/database/query.inc
index 8af91c2d..c9c5a832 100644
--- a/drupal7/includes/database/query.inc
+++ b/drupal7/includes/database/query.inc
@@ -1694,7 +1694,7 @@ class DatabaseCondition implements QueryConditionInterface, Countable {
    * Implements Countable::count().
    *
    * Returns the size of this conditional. The size of the conditional is the
-   * size of its conditional array minus one, because one element is the the
+   * size of its conditional array minus one, because one element is the
    * conjunction.
    */
   public function count() {
diff --git a/drupal7/includes/entity.inc b/drupal7/includes/entity.inc
index 203ed87f..27434d04 100644
--- a/drupal7/includes/entity.inc
+++ b/drupal7/includes/entity.inc
@@ -28,7 +28,9 @@ interface DrupalEntityControllerInterface {
    * @param $ids
    *   An array of entity IDs, or FALSE to load all entities.
    * @param $conditions
-   *   An array of conditions in the form 'field' => $value.
+   *   An array of conditions. Keys are field names on the entity's base table.
+   *   Values will be compared for equality. All the comparisons will be ANDed
+   *   together. This parameter is deprecated; use an EntityFieldQuery instead.
    *
    * @return
    *   An array of entity objects indexed by their ids. When no results are
@@ -236,7 +238,9 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
    * @param $ids
    *   An array of entity IDs, or FALSE to load all entities.
    * @param $conditions
-   *   An array of conditions in the form 'field' => $value.
+   *   An array of conditions. Keys are field names on the entity's base table.
+   *   Values will be compared for equality. All the comparisons will be ANDed
+   *   together. This parameter is deprecated; use an EntityFieldQuery instead.
    * @param $revision_id
    *   The ID of the revision to load, or FALSE if this query is asking for the
    *   most current revision(s).
diff --git a/drupal7/includes/file.inc b/drupal7/includes/file.inc
index 803661f4..d3ac87ea 100644
--- a/drupal7/includes/file.inc
+++ b/drupal7/includes/file.inc
@@ -1559,7 +1559,7 @@ function file_save_upload($form_field_name, $validators = array(), $destination
     return FALSE;
   }
 
-  // Add in our check of the the file name length.
+  // Add in our check of the file name length.
   $validators['file_validate_name_length'] = array();
 
   // Call the validation functions specified by this function's caller.
diff --git a/drupal7/includes/form.inc b/drupal7/includes/form.inc
index da1caa81..0d358c2b 100644
--- a/drupal7/includes/form.inc
+++ b/drupal7/includes/form.inc
@@ -938,7 +938,7 @@ function drupal_process_form($form_id, &$form, &$form_state) {
         // after the batch is processed.
       }
 
-      // Set a flag to indicate the the form has been processed and executed.
+      // Set a flag to indicate that the form has been processed and executed.
       $form_state['executed'] = TRUE;
 
       // Redirect the form based on values in $form_state.
@@ -2451,6 +2451,17 @@ function form_type_password_confirm_value($element, $input = FALSE) {
     $element += array('#default_value' => array());
     return $element['#default_value'] + array('pass1' => '', 'pass2' => '');
   }
+  $value = array('pass1' => '', 'pass2' => '');
+  // Throw out all invalid array keys; we only allow pass1 and pass2.
+  foreach ($value as $allowed_key => $default) {
+    // These should be strings, but allow other scalars since they might be
+    // valid input in programmatic form submissions. Any nested array values
+    // are ignored.
+    if (isset($input[$allowed_key]) && is_scalar($input[$allowed_key])) {
+      $value[$allowed_key] = (string) $input[$allowed_key];
+    }
+  }
+  return $value;
 }
 
 /**
@@ -2494,6 +2505,27 @@ function form_type_select_value($element, $input = FALSE) {
   }
 }
 
+/**
+ * Determines the value for a textarea form element.
+ *
+ * @param array $element
+ *   The form element whose value is being populated.
+ * @param mixed $input
+ *   The incoming input to populate the form element. If this is FALSE,
+ *   the element's default value should be returned.
+ *
+ * @return string
+ *   The data that will appear in the $element_state['values'] collection
+ *   for this element. Return nothing to use the default.
+ */
+function form_type_textarea_value($element, $input = FALSE) {
+  if ($input !== FALSE) {
+    // This should be a string, but allow other scalars since they might be
+    // valid input in programmatic form submissions.
+    return is_scalar($input) ? (string) $input : '';
+  }
+}
+
 /**
  * Determines the value for a textfield form element.
  *
@@ -2509,9 +2541,12 @@ function form_type_select_value($element, $input = FALSE) {
  */
 function form_type_textfield_value($element, $input = FALSE) {
   if ($input !== FALSE && $input !== NULL) {
-    // Equate $input to the form value to ensure it's marked for
-    // validation.
-    return str_replace(array("\r", "\n"), '', $input);
+    // This should be a string, but allow other scalars since they might be
+    // valid input in programmatic form submissions.
+    if (!is_scalar($input)) {
+      $input = '';
+    }
+    return str_replace(array("\r", "\n"), '', (string) $input);
   }
 }
 
diff --git a/drupal7/includes/install.inc b/drupal7/includes/install.inc
index f13ee8ac..2b55589f 100644
--- a/drupal7/includes/install.inc
+++ b/drupal7/includes/install.inc
@@ -653,6 +653,13 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') {
     if ($fp && fwrite($fp, $buffer) === FALSE) {
       throw new Exception(st('Failed to modify %settings. Verify the file permissions.', array('%settings' => $settings_file)));
     }
+    else {
+      // The existing settings.php file might have been included already. In
+      // case an opcode cache is enabled, the rewritten contents of the file
+      // will not be reflected in this process. Ensure to invalidate the file
+      // in case an opcode cache is enabled.
+      drupal_clear_opcode_cache(DRUPAL_ROOT . '/' . $settings_file);
+    }
   }
   else {
     throw new Exception(st('Failed to open %settings. Verify the file permissions.', array('%settings' => $default_settings)));
diff --git a/drupal7/includes/language.inc b/drupal7/includes/language.inc
index 803a6304..24267d8a 100644
--- a/drupal7/includes/language.inc
+++ b/drupal7/includes/language.inc
@@ -297,7 +297,7 @@ function language_negotiation_get_switch_links($type, $path) {
       // Add support for WCAG 2.0's Language of Parts to add language identifiers.
       // http://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-other-lang-id.html
       foreach ($result as $langcode => $link) {
-        $result[$langcode]['attributes']['lang'] = $langcode;
+        $result[$langcode]['attributes']['xml:lang'] = $langcode;
       }
 
       if (!empty($result)) {
diff --git a/drupal7/includes/locale.inc b/drupal7/includes/locale.inc
index 00ac1880..c7f95838 100644
--- a/drupal7/includes/locale.inc
+++ b/drupal7/includes/locale.inc
@@ -1931,7 +1931,7 @@ function _locale_translate_seek() {
       $groups[$string['group']],
       array('data' => check_plain(truncate_utf8($string['source'], 150, FALSE, TRUE)) . '<br /><small>' . $string['location'] . '</small>'),
       $string['context'],
-      array('data' => _locale_translate_language_list($string['languages'], $limit_language), 'align' => 'center'),
+      array('data' => _locale_translate_language_list($string, $limit_language), 'align' => 'center'),
       array('data' => l(t('edit'), "admin/config/regional/translate/edit/$lid", array('query' => drupal_get_destination())), 'class' => array('nowrap')),
       array('data' => l(t('delete'), "admin/config/regional/translate/delete/$lid", array('query' => drupal_get_destination())), 'class' => array('nowrap')),
     );
@@ -2126,16 +2126,21 @@ function _locale_rebuild_js($langcode = NULL) {
 /**
  * List languages in search result table
  */
-function _locale_translate_language_list($translation, $limit_language) {
+function _locale_translate_language_list($string, $limit_language) {
   // Add CSS.
   drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css');
 
+  // Include both translated and not yet translated target languages in the
+  // list. The source language is English for built-in strings and the default
+  // language for other strings.
   $languages = language_list();
-  unset($languages['en']);
+  $default = language_default();
+  $omit = $string['group'] == 'default' ? 'en' : $default->language;
+  unset($languages[$omit]);
   $output = '';
   foreach ($languages as $langcode => $language) {
     if (!$limit_language || $limit_language == $langcode) {
-      $output .= (!empty($translation[$langcode])) ? $langcode . ' ' : "<em class=\"locale-untranslated\">$langcode</em> ";
+      $output .= (!empty($string['languages'][$langcode])) ? $langcode . ' ' : "<em class=\"locale-untranslated\">$langcode</em> ";
     }
   }
 
diff --git a/drupal7/includes/menu.inc b/drupal7/includes/menu.inc
index 2bfa39f6..8e26b6de 100644
--- a/drupal7/includes/menu.inc
+++ b/drupal7/includes/menu.inc
@@ -456,7 +456,9 @@ function menu_get_item($path = NULL, $router_item = NULL) {
     // Rebuild if we know it's needed, or if the menu masks are missing which
     // occurs rarely, likely due to a race condition of multiple rebuilds.
     if (variable_get('menu_rebuild_needed', FALSE) || !variable_get('menu_masks', array())) {
-      menu_rebuild();
+      if (_menu_check_rebuild()) {
+        menu_rebuild();
+      }
     }
     $original_map = arg(NULL, $path);
 
@@ -2693,6 +2695,21 @@ function menu_reset_static_cache() {
   drupal_static_reset('menu_link_get_preferred');
 }
 
+/**
+ * Checks whether a menu_rebuild() is necessary.
+ */
+function _menu_check_rebuild() {
+  // To absolutely ensure that the menu rebuild is required, re-load the
+  // variables in case they were set by another process.
+  $variables = variable_initialize();
+  if (empty($variables['menu_rebuild_needed']) && !empty($variables['menu_masks'])) {
+    unset($GLOBALS['conf']['menu_rebuild_needed']);
+    $GLOBALS['conf']['menu_masks'] = $variables['menu_masks'];
+    return FALSE;
+  }
+  return TRUE;
+}
+
 /**
  * Populates the database tables used by various menu functions.
  *
@@ -2713,6 +2730,14 @@ function menu_rebuild() {
     // We choose to block here since otherwise the router item may not
     // be available in menu_execute_active_handler() resulting in a 404.
     lock_wait('menu_rebuild');
+
+    if (_menu_check_rebuild()) {
+      // If we get here and menu_masks was not set, then it is possible a menu
+      // is being reloaded, or that the process rebuilding the menu was unable
+      // to complete successfully. A missing menu_masks variable could result
+      // in a 404, so re-run the function.
+      return menu_rebuild();
+    }
     return FALSE;
   }
 
@@ -2737,6 +2762,12 @@ function menu_rebuild() {
     $transaction->rollback();
     watchdog_exception('menu', $e);
   }
+  // Explicitly commit the transaction now; this ensures that the database
+  // operations during the menu rebuild are committed before the lock is made
+  // available again, since locks may not always reside in the same database
+  // connection. The lock is acquired outside of the transaction so should also
+  // be released outside of it.
+  unset($transaction);
 
   lock_release('menu_rebuild');
   return TRUE;
diff --git a/drupal7/includes/module.inc b/drupal7/includes/module.inc
index fe2a9805..494924f5 100644
--- a/drupal7/includes/module.inc
+++ b/drupal7/includes/module.inc
@@ -265,11 +265,11 @@ function _module_build_dependencies($files) {
 /**
  * Determines whether a given module exists.
  *
- * @param $module
+ * @param string $module
  *   The name of the module (without the .module extension).
  *
- * @return
- *   TRUE if the module is both installed and enabled.
+ * @return bool
+ *   TRUE if the module is both installed and enabled, FALSE otherwise.
  */
 function module_exists($module) {
   $list = module_list();
diff --git a/drupal7/includes/theme.inc b/drupal7/includes/theme.inc
index ed34b828..8d5348df 100644
--- a/drupal7/includes/theme.inc
+++ b/drupal7/includes/theme.inc
@@ -1691,7 +1691,7 @@ function theme_status_messages($variables) {
       $output .= " </ul>\n";
     }
     else {
-      $output .= $messages[0];
+      $output .= reset($messages);
     }
     $output .= "</div>\n";
   }
@@ -2622,6 +2622,9 @@ function template_preprocess_page(&$variables) {
     if (!isset($variables['page'][$region_key])) {
       $variables['page'][$region_key] = array();
     }
+    if ($region_content = drupal_get_region_content($region_key)) {
+      $variables['page'][$region_key][]['#markup'] = $region_content;
+    }
   }
 
   // Set up layout variable.
diff --git a/drupal7/misc/autocomplete.js b/drupal7/misc/autocomplete.js
index 8f7ac601..56790817 100644
--- a/drupal7/misc/autocomplete.js
+++ b/drupal7/misc/autocomplete.js
@@ -114,6 +114,7 @@ Drupal.jsAC.prototype.onkeyup = function (input, e) {
  */
 Drupal.jsAC.prototype.select = function (node) {
   this.input.value = $(node).data('autocompleteValue');
+  $(this.input).trigger('autocompleteSelect', [node]);
 };
 
 /**
@@ -167,7 +168,7 @@ Drupal.jsAC.prototype.unhighlight = function (node) {
 Drupal.jsAC.prototype.hidePopup = function (keycode) {
   // Select item if the right key or mousebutton was pressed.
   if (this.selected && ((keycode && keycode != 46 && keycode != 8 && keycode != 27) || !keycode)) {
-    this.input.value = $(this.selected).data('autocompleteValue');
+    this.select(this.selected);
   }
   // Hide popup.
   var popup = this.popup;
@@ -220,7 +221,7 @@ Drupal.jsAC.prototype.found = function (matches) {
   for (key in matches) {
     $('<li></li>')
       .html($('<div></div>').html(matches[key]))
-      .mousedown(function () { ac.select(this); })
+      .mousedown(function () { ac.hidePopup(this); })
       .mouseover(function () { ac.highlight(this); })
       .mouseout(function () { ac.unhighlight(this); })
       .data('autocompleteValue', key)
diff --git a/drupal7/misc/favicon.ico b/drupal7/misc/favicon.ico
index 3417ec24..61f840fa 100644
Binary files a/drupal7/misc/favicon.ico and b/drupal7/misc/favicon.ico differ
diff --git a/drupal7/misc/tabledrag.js b/drupal7/misc/tabledrag.js
index fed674ca..3cc27019 100644
--- a/drupal7/misc/tabledrag.js
+++ b/drupal7/misc/tabledrag.js
@@ -500,7 +500,7 @@ Drupal.tableDrag.prototype.dragRow = function (event, self) {
     if (self.indentEnabled) {
       var xDiff = self.currentMouseCoords.x - self.dragObject.indentMousePos.x;
       // Set the number of indentations the mouse has been moved left or right.
-      var indentDiff = Math.round(xDiff / self.indentAmount * self.rtl);
+      var indentDiff = Math.round(xDiff / self.indentAmount);
       // Indent the row with our estimated diff, which may be further
       // restricted according to the rows around this row.
       var indentChange = self.rowObject.indent(indentDiff);
diff --git a/drupal7/misc/tableselect.js b/drupal7/misc/tableselect.js
index fee63a9f..09bac139 100644
--- a/drupal7/misc/tableselect.js
+++ b/drupal7/misc/tableselect.js
@@ -57,10 +57,14 @@ Drupal.tableSelect = function () {
     // Keep track of the last checked checkbox.
     lastChecked = e.target;
   });
+
+  // If all checkboxes are checked on page load, make sure the select-all one
+  // is checked too, otherwise keep unchecked.
+  updateSelectAll((checkboxes.length == $(checkboxes).filter(':checked').length));
 };
 
 Drupal.tableSelectRange = function (from, to, state) {
-  // We determine the looping mode based on the the order of from and to.
+  // We determine the looping mode based on the order of from and to.
   var mode = from.rowIndex > to.rowIndex ? 'previousSibling' : 'nextSibling';
 
   // Traverse through the sibling nodes.
diff --git a/drupal7/misc/vertical-tabs.js b/drupal7/misc/vertical-tabs.js
index ebfaa4f7..3aa0f6f9 100644
--- a/drupal7/misc/vertical-tabs.js
+++ b/drupal7/misc/vertical-tabs.js
@@ -134,6 +134,8 @@ Drupal.verticalTab.prototype = {
   tabShow: function () {
     // Display the tab.
     this.item.show();
+    // Show the vertical tabs.
+    this.item.closest('.vertical-tabs').show();
     // Update .first marker for items. We need recurse from parent to retain the
     // actual DOM element order as jQuery implements sortOrder, but not as public
     // method.
@@ -164,6 +166,10 @@ Drupal.verticalTab.prototype = {
     if ($firstTab.length) {
       $firstTab.data('verticalTab').focus();
     }
+    // Hide the vertical tabs (if no tabs remain).
+    else {
+      this.item.closest('.vertical-tabs').hide();
+    }
     return this;
   }
 };
diff --git a/drupal7/modules/aggregator/aggregator.info b/drupal7/modules/aggregator/aggregator.info
index b63fe6cf..74ed35a4 100644
--- a/drupal7/modules/aggregator/aggregator.info
+++ b/drupal7/modules/aggregator/aggregator.info
@@ -7,8 +7,8 @@ files[] = aggregator.test
 configure = admin/config/services/aggregator/settings
 stylesheets[all][] = aggregator.css
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/aggregator/tests/aggregator_test.info b/drupal7/modules/aggregator/tests/aggregator_test.info
index 7250ac41..7a9c2f9a 100644
--- a/drupal7/modules/aggregator/tests/aggregator_test.info
+++ b/drupal7/modules/aggregator/tests/aggregator_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/block/block.info b/drupal7/modules/block/block.info
index 36765c98..b67b6d15 100644
--- a/drupal7/modules/block/block.info
+++ b/drupal7/modules/block/block.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = block.test
 configure = admin/structure/block
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/block/block.module b/drupal7/modules/block/block.module
index b6a73326..48c80d76 100644
--- a/drupal7/modules/block/block.module
+++ b/drupal7/modules/block/block.module
@@ -66,7 +66,7 @@ function block_help($path, $arg) {
     $demo_theme = !empty($arg[4]) ? $arg[4] : variable_get('theme_default', 'bartik');
     $themes = list_themes();
     $output = '<p>' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page. Click the <em>configure</em> link next to each block to configure its specific title and visibility settings.') . '</p>';
-    $output .= '<p>' . l(t('Demonstrate block regions (@theme)', array('@theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '</p>';
+    $output .= '<p>' . l(t('Demonstrate block regions (!theme)', array('!theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '</p>';
     return $output;
   }
 }
@@ -143,7 +143,7 @@ function block_menu() {
   );
   foreach (list_themes() as $key => $theme) {
     $items['admin/structure/block/list/' . $key] = array(
-      'title' => check_plain($theme->info['name']),
+      'title' => $theme->info['name'],
       'page arguments' => array($key),
       'type' => $key == $default_theme ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
       'weight' => $key == $default_theme ? -10 : 0,
@@ -162,7 +162,7 @@ function block_menu() {
       );
     }
     $items['admin/structure/block/demo/' . $key] = array(
-      'title' => check_plain($theme->info['name']),
+      'title' => $theme->info['name'],
       'page callback' => 'block_admin_demo',
       'page arguments' => array($key),
       'type' => MENU_CALLBACK,
@@ -692,6 +692,9 @@ function block_list($region) {
 /**
  * Loads a block object from the database.
  *
+ * This function returns the first block matching the module and delta
+ * parameters, so it should not be used for theme-specific functionality.
+ *
  * @param $module
  *   Name of the module that implements the block to load.
  * @param $delta
diff --git a/drupal7/modules/block/block.test b/drupal7/modules/block/block.test
index 99c81dc6..f20e3c87 100644
--- a/drupal7/modules/block/block.test
+++ b/drupal7/modules/block/block.test
@@ -75,7 +75,7 @@ class BlockTestCase extends DrupalWebTestCase {
     $bid = db_query("SELECT bid FROM {block_custom} WHERE info = :info", array(':info' => $custom_block['info']))->fetchField();
 
     // Check to see if the custom block was created by checking that it's in the database.
-    $this->assertNotNull($bid, 'Custom block found in database');
+    $this->assertTrue($bid, 'Custom block found in database');
 
     // Check that block_block_view() returns the correct title and content.
     $data = block_block_view($bid);
@@ -305,7 +305,7 @@ class BlockTestCase extends DrupalWebTestCase {
     ))->fetchField();
 
     // Check to see if the block was created by checking that it's in the database.
-    $this->assertNotNull($bid, 'Block found in database');
+    $this->assertTrue($bid, 'Block found in database');
 
     // Check whether the block can be moved to all available regions.
     foreach ($this->regions as $region) {
diff --git a/drupal7/modules/block/tests/block_test.info b/drupal7/modules/block/tests/block_test.info
index f8503da4..2a54e18c 100644
--- a/drupal7/modules/block/tests/block_test.info
+++ b/drupal7/modules/block/tests/block_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/block/tests/themes/block_test_theme/block_test_theme.info b/drupal7/modules/block/tests/themes/block_test_theme/block_test_theme.info
index 42c11a5b..62b7a5e4 100644
--- a/drupal7/modules/block/tests/themes/block_test_theme/block_test_theme.info
+++ b/drupal7/modules/block/tests/themes/block_test_theme/block_test_theme.info
@@ -13,8 +13,8 @@ regions[footer] = Footer
 regions[highlighted] = Highlighted
 regions[help] = Help
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/blog/blog.info b/drupal7/modules/blog/blog.info
index 8dc53ac9..abb1946c 100644
--- a/drupal7/modules/blog/blog.info
+++ b/drupal7/modules/blog/blog.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = blog.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/book/book.info b/drupal7/modules/book/book.info
index a8997888..e8003e12 100644
--- a/drupal7/modules/book/book.info
+++ b/drupal7/modules/book/book.info
@@ -7,8 +7,8 @@ files[] = book.test
 configure = admin/content/book/settings
 stylesheets[all][] = book.css
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/color/color.info b/drupal7/modules/color/color.info
index 9a21379c..1fef8cd3 100644
--- a/drupal7/modules/color/color.info
+++ b/drupal7/modules/color/color.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = color.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/comment/comment.info b/drupal7/modules/comment/comment.info
index 864286da..a4f24d83 100644
--- a/drupal7/modules/comment/comment.info
+++ b/drupal7/modules/comment/comment.info
@@ -9,8 +9,8 @@ files[] = comment.test
 configure = admin/content/comment
 stylesheets[all][] = comment.css
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/comment/comment.module b/drupal7/modules/comment/comment.module
index 2972474c..6f0df6ca 100644
--- a/drupal7/modules/comment/comment.module
+++ b/drupal7/modules/comment/comment.module
@@ -2607,7 +2607,7 @@ function comment_unpublish_action($comment, $context = array()) {
 /**
  * Unpublishes a comment if it contains certain keywords.
  *
- * @param $comment
+ * @param object $comment
  *   Comment object to modify.
  * @param array $context
  *   Array with components:
@@ -2619,10 +2619,13 @@ function comment_unpublish_action($comment, $context = array()) {
  * @see comment_unpublish_by_keyword_action_submit()
  */
 function comment_unpublish_by_keyword_action($comment, $context) {
+  $node = node_load($comment->nid);
+  $build = comment_view($comment, $node);
+  $text = drupal_render($build);
   foreach ($context['keywords'] as $keyword) {
-    $text = drupal_render($comment);
     if (strpos($text, $keyword) !== FALSE) {
       $comment->status = COMMENT_NOT_PUBLISHED;
+      comment_save($comment);
       watchdog('action', 'Unpublished comment %subject.', array('%subject' => $comment->subject));
       break;
     }
diff --git a/drupal7/modules/comment/comment.test b/drupal7/modules/comment/comment.test
index 9e69ba62..dc7aad3e 100644
--- a/drupal7/modules/comment/comment.test
+++ b/drupal7/modules/comment/comment.test
@@ -13,7 +13,7 @@ class CommentHelperCase extends DrupalWebTestCase {
   function setUp() {
     parent::setUp('comment', 'search');
     // Create users and test node.
-    $this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer comments', 'administer blocks'));
+    $this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer comments', 'administer blocks', 'administer actions'));
     $this->web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'create article content', 'edit own comments'));
     $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'uid' => $this->web_user->uid));
   }
@@ -1973,6 +1973,41 @@ class CommentActionsTestCase extends CommentHelperCase {
     $this->clearWatchdog();
   }
 
+  /**
+   * Tests the unpublish comment by keyword action.
+   */
+  public function testCommentUnpublishByKeyword() {
+    $this->drupalLogin($this->admin_user);
+    $callback = 'comment_unpublish_by_keyword_action';
+    $hash = drupal_hash_base64($callback);
+    $comment_text = $keywords = $this->randomName();
+    $edit = array(
+      'actions_label' => $callback,
+      'keywords' => $keywords,
+    );
+
+    $this->drupalPost("admin/config/system/actions/configure/$hash", $edit, t('Save'));
+
+    $action = db_query("SELECT aid, type, callback, parameters, label FROM {actions} WHERE callback = :callback", array(':callback' => $callback))->fetchObject();
+
+    $this->assertTrue($action, 'The action could be loaded.');
+
+    $comment = $this->postComment($this->node, $comment_text, $this->randomName());
+
+    // Load the full comment so that status is available.
+    $comment = comment_load($comment->id);
+
+    $this->assertTrue($comment->status == COMMENT_PUBLISHED, 'The comment status was set to published.');
+
+    comment_unpublish_by_keyword_action($comment, array('keywords' => array($keywords)));
+
+    // We need to make sure that the comment has been saved with status
+    // unpublished.
+    $this->assertEqual(comment_load($comment->cid)->status, COMMENT_NOT_PUBLISHED, 'Comment was unpublished.');
+    $this->assertWatchdogMessage('Unpublished comment %subject.', array('%subject' => $comment->subject), 'Found watchdog message.');
+    $this->clearWatchdog();
+  }
+
   /**
    * Verify that a watchdog message has been entered.
    *
diff --git a/drupal7/modules/contact/contact.info b/drupal7/modules/contact/contact.info
index f2c5de1f..e3b6c393 100644
--- a/drupal7/modules/contact/contact.info
+++ b/drupal7/modules/contact/contact.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = contact.test
 configure = admin/structure/contact
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/contact/contact.pages.inc b/drupal7/modules/contact/contact.pages.inc
index ba8918bf..233818ce 100644
--- a/drupal7/modules/contact/contact.pages.inc
+++ b/drupal7/modules/contact/contact.pages.inc
@@ -134,7 +134,7 @@ function contact_site_form_submit($form, &$form_state) {
   global $user, $language;
 
   $values = $form_state['values'];
-  $values['sender'] = $user;
+  $values['sender'] = clone $user;
   $values['sender']->name = $values['name'];
   $values['sender']->mail = $values['mail'];
   $values['category'] = contact_load($values['cid']);
@@ -270,7 +270,7 @@ function contact_personal_form_submit($form, &$form_state) {
   global $user, $language;
 
   $values = $form_state['values'];
-  $values['sender'] = $user;
+  $values['sender'] = clone $user;
   $values['sender']->name = $values['name'];
   $values['sender']->mail = $values['mail'];
 
diff --git a/drupal7/modules/contextual/contextual.info b/drupal7/modules/contextual/contextual.info
index ef6380a8..e7aa2e75 100644
--- a/drupal7/modules/contextual/contextual.info
+++ b/drupal7/modules/contextual/contextual.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = contextual.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/dashboard/dashboard.info b/drupal7/modules/dashboard/dashboard.info
index 00e3b30f..c19cee4c 100644
--- a/drupal7/modules/dashboard/dashboard.info
+++ b/drupal7/modules/dashboard/dashboard.info
@@ -7,8 +7,8 @@ files[] = dashboard.test
 dependencies[] = block
 configure = admin/dashboard/customize
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/dblog/dblog.info b/drupal7/modules/dblog/dblog.info
index 1057d415..96aa2acc 100644
--- a/drupal7/modules/dblog/dblog.info
+++ b/drupal7/modules/dblog/dblog.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = dblog.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/field/field.api.php b/drupal7/modules/field/field.api.php
index e8361c22..f9370912 100644
--- a/drupal7/modules/field/field.api.php
+++ b/drupal7/modules/field/field.api.php
@@ -1897,7 +1897,7 @@ function hook_field_storage_write($entity_type, $entity, $op, $fields) {
       $items = (array) $entity->{$field_name}[$langcode];
       $delta_count = 0;
       foreach ($items as $delta => $item) {
-        // We now know we have someting to insert.
+        // We now know we have something to insert.
         $do_insert = TRUE;
         $record = array(
           'entity_type' => $entity_type,
diff --git a/drupal7/modules/field/field.info b/drupal7/modules/field/field.info
index b6b5e688..cff24b38 100644
--- a/drupal7/modules/field/field.info
+++ b/drupal7/modules/field/field.info
@@ -11,8 +11,8 @@ dependencies[] = field_sql_storage
 required = TRUE
 stylesheets[all][] = theme/field.css
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/field/field.module b/drupal7/modules/field/field.module
index a593e511..e4039786 100644
--- a/drupal7/modules/field/field.module
+++ b/drupal7/modules/field/field.module
@@ -894,6 +894,7 @@ function field_view_field($entity_type, $entity, $field_name, $display = array()
       'entity' => $entity,
       'view_mode' => '_custom',
       'display' => $display,
+      'language' => $langcode,
     );
     drupal_alter('field_attach_view', $result, $context);
 
diff --git a/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.info b/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.info
index 6f04effb..fa69cd65 100644
--- a/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.info
+++ b/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.info
@@ -7,8 +7,8 @@ dependencies[] = field
 files[] = field_sql_storage.test
 required = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.module b/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.module
index 7ab4ee5c..c7201dd7 100644
--- a/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.module
+++ b/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.module
@@ -465,7 +465,7 @@ function field_sql_storage_field_storage_write($entity_type, $entity, $op, $fiel
       $items = (array) $entity->{$field_name}[$langcode];
       $delta_count = 0;
       foreach ($items as $delta => $item) {
-        // We now know we have someting to insert.
+        // We now know we have something to insert.
         $do_insert = TRUE;
         $record = array(
           'entity_type' => $entity_type,
diff --git a/drupal7/modules/field/modules/list/list.info b/drupal7/modules/field/modules/list/list.info
index 97797629..7868d0be 100644
--- a/drupal7/modules/field/modules/list/list.info
+++ b/drupal7/modules/field/modules/list/list.info
@@ -7,8 +7,8 @@ dependencies[] = field
 dependencies[] = options
 files[] = tests/list.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/field/modules/list/tests/list_test.info b/drupal7/modules/field/modules/list/tests/list_test.info
index fa5e2860..b58989d1 100644
--- a/drupal7/modules/field/modules/list/tests/list_test.info
+++ b/drupal7/modules/field/modules/list/tests/list_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/field/modules/number/number.info b/drupal7/modules/field/modules/number/number.info
index 419e31f1..bd7b05f0 100644
--- a/drupal7/modules/field/modules/number/number.info
+++ b/drupal7/modules/field/modules/number/number.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = number.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/field/modules/options/options.info b/drupal7/modules/field/modules/options/options.info
index 17b78bfd..da0db802 100644
--- a/drupal7/modules/field/modules/options/options.info
+++ b/drupal7/modules/field/modules/options/options.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = options.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/field/modules/text/text.info b/drupal7/modules/field/modules/text/text.info
index 9651c41b..c3ebfb37 100644
--- a/drupal7/modules/field/modules/text/text.info
+++ b/drupal7/modules/field/modules/text/text.info
@@ -7,8 +7,8 @@ dependencies[] = field
 files[] = text.test
 required = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/field/tests/field.test b/drupal7/modules/field/tests/field.test
index b279d6a8..adf2413b 100644
--- a/drupal7/modules/field/tests/field.test
+++ b/drupal7/modules/field/tests/field.test
@@ -2206,11 +2206,12 @@ class FieldDisplayAPITestCase extends FieldTestCase {
         'alter' => TRUE,
       ),
     );
-    $output = field_view_field('test_entity', $this->entity, $this->field_name, $display);
+    $output = field_view_field('test_entity', $this->entity, $this->field_name, $display, LANGUAGE_NONE);
     $this->drupalSetContent(drupal_render($output));
     $setting = $display['settings']['test_formatter_setting_multiple'];
     $this->assertNoText($this->label, 'Label was not displayed.');
     $this->assertText('field_test_field_attach_view_alter', 'Alter fired, display passed.');
+    $this->assertText('field language is ' . LANGUAGE_NONE, 'Language is placed onto the context.');
     $array = array();
     foreach ($this->values as $delta => $value) {
       $array[] = $delta . ':' . $value['value'];
diff --git a/drupal7/modules/field/tests/field_test.info b/drupal7/modules/field/tests/field_test.info
index a4aa68c7..75ec4bc3 100644
--- a/drupal7/modules/field/tests/field_test.info
+++ b/drupal7/modules/field/tests/field_test.info
@@ -6,8 +6,8 @@ files[] = field_test.entity.inc
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/field/tests/field_test.module b/drupal7/modules/field/tests/field_test.module
index 9daa2c30..7e9bba0d 100644
--- a/drupal7/modules/field/tests/field_test.module
+++ b/drupal7/modules/field/tests/field_test.module
@@ -220,6 +220,10 @@ function field_test_field_attach_view_alter(&$output, $context) {
   if (!empty($context['display']['settings']['alter'])) {
     $output['test_field'][] = array('#markup' => 'field_test_field_attach_view_alter');
   }
+
+  if (isset($output['test_field'])) {
+    $output['test_field'][] = array('#markup' => 'field language is ' . $context['language']);
+  }
 }
 
 /**
diff --git a/drupal7/modules/field_ui/field_ui.info b/drupal7/modules/field_ui/field_ui.info
index 8fcd7e5d..5e3a728d 100644
--- a/drupal7/modules/field_ui/field_ui.info
+++ b/drupal7/modules/field_ui/field_ui.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = field_ui.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/field_ui/field_ui.js b/drupal7/modules/field_ui/field_ui.js
index 65b28d04..c2e8978d 100644
--- a/drupal7/modules/field_ui/field_ui.js
+++ b/drupal7/modules/field_ui/field_ui.js
@@ -168,7 +168,7 @@ Drupal.fieldUIOverview = {
     var dragObject = this;
     var row = dragObject.rowObject.element;
     var rowHandler = $(row).data('fieldUIRowHandler');
-    if (rowHandler !== undefined) {
+    if (typeof rowHandler !== 'undefined') {
       var regionRow = $(row).prevAll('tr.region-message').get(0);
       var region = regionRow.className.replace(/([^ ]+[ ]+)*region-([^ ]+)-message([ ]+[^ ]+)*/, '$2');
 
@@ -319,7 +319,7 @@ Drupal.fieldUIDisplayOverview.field.prototype = {
         if (currentValue == 'hidden') {
           // Restore the formatter back to the default formatter. Pseudo-fields do
           // not have default formatters, we just return to 'visible' for those.
-          var value = (this.defaultFormatter != undefined) ? this.defaultFormatter : 'visible';
+          var value = (typeof this.defaultFormatter !== 'undefined') ? this.defaultFormatter : this.$formatSelect.find('option').val();
         }
         break;
 
diff --git a/drupal7/modules/file/file.field.inc b/drupal7/modules/file/file.field.inc
index b26d7e45..794f16e6 100644
--- a/drupal7/modules/file/file.field.inc
+++ b/drupal7/modules/file/file.field.inc
@@ -252,6 +252,12 @@ function file_field_insert($entity_type, $entity, $field, $instance, $langcode,
  * Checks for files that have been removed from the object.
  */
 function file_field_update($entity_type, $entity, $field, $instance, $langcode, &$items) {
+  // Check whether the field is defined on the object.
+  if (!isset($entity->{$field['field_name']})) {
+    // We cannot check for removed files if the field is not defined.
+    return;
+  }
+
   list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
 
   // On new revisions, all files are considered to be a new usage and no
diff --git a/drupal7/modules/file/file.info b/drupal7/modules/file/file.info
index cf9170df..d15ee6e3 100644
--- a/drupal7/modules/file/file.info
+++ b/drupal7/modules/file/file.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = tests/file.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/file/file.module b/drupal7/modules/file/file.module
index a4a7f03d..ae452a68 100644
--- a/drupal7/modules/file/file.module
+++ b/drupal7/modules/file/file.module
@@ -357,6 +357,10 @@ function file_file_delete($file) {
  * support for a default value.
  */
 function file_managed_file_process($element, &$form_state, $form) {
+  // Append the '-upload' to the #id so the field label's 'for' attribute
+  // corresponds with the file element.
+  $original_id = $element['#id'];
+  $element['#id'] .= '-upload';
   $fid = isset($element['#value']['fid']) ? $element['#value']['fid'] : 0;
 
   // Set some default element properties.
@@ -366,7 +370,7 @@ function file_managed_file_process($element, &$form_state, $form) {
 
   $ajax_settings = array(
     'path' => 'file/ajax/' . implode('/', $element['#array_parents']) . '/' . $form['form_build_id']['#value'],
-    'wrapper' => $element['#id'] . '-ajax-wrapper',
+    'wrapper' => $original_id . '-ajax-wrapper',
     'effect' => 'fade',
     'progress' => array(
       'type' => $element['#progress_indicator'],
@@ -461,13 +465,13 @@ function file_managed_file_process($element, &$form_state, $form) {
     $element['upload']['#attached']['js'] = array(
       array(
         'type' => 'setting',
-        'data' => array('file' => array('elements' => array('#' . $element['#id'] . '-upload' => $extension_list)))
+        'data' => array('file' => array('elements' => array('#' . $element['#id'] => $extension_list)))
       )
     );
   }
 
   // Prefix and suffix used for Ajax replacement.
-  $element['#prefix'] = '<div id="' . $element['#id'] . '-ajax-wrapper">';
+  $element['#prefix'] = '<div id="' . $original_id . '-ajax-wrapper">';
   $element['#suffix'] = '</div>';
 
   return $element;
@@ -515,7 +519,17 @@ function file_managed_file_value(&$element, $input = FALSE, $form_state = NULL)
       // public file) to confirm it exists and that the current user has access
       // to it.
       if (isset($input['fid']) && ($file = file_load($input['fid']))) {
-        if (file_uri_scheme($file->uri) == 'public' || file_download_access($file->uri)) {
+        // By default the public:// file scheme provided by Drupal core is the
+        // only one that allows files to be publicly accessible to everyone, so
+        // it is the only one for which the file access checks are bypassed.
+        // Other modules which provide publicly accessible streams of their own
+        // in hook_stream_wrappers() can add the corresponding scheme to the
+        // 'file_public_schema' variable to bypass file access checks for those
+        // as well. This should only be done for schemes that are completely
+        // publicly accessible, with no download restrictions; for security
+        // reasons all other schemes must go through the file_download_access()
+        // check.
+        if (in_array(file_uri_scheme($file->uri), variable_get('file_public_schema', array('public'))) || file_download_access($file->uri)) {
           $fid = $file->fid;
         }
         // If the current user doesn't have access, don't let the file be
diff --git a/drupal7/modules/file/tests/file.test b/drupal7/modules/file/tests/file.test
index 0f6a578d..33d7afd1 100644
--- a/drupal7/modules/file/tests/file.test
+++ b/drupal7/modules/file/tests/file.test
@@ -474,6 +474,15 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
       $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0];
       $this->assertFileExists($node_file, 'New file saved to disk on node creation.');
 
+      // Test that running field_attach_update() leaves the file intact.
+      $field = new stdClass();
+      $field->type = $type_name;
+      $field->nid = $nid;
+      field_attach_update('node', $field);
+      $node = node_load($nid);
+      $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0];
+      $this->assertFileExists($node_file, 'New file still saved to disk on field update.');
+
       // Ensure the file can be downloaded.
       $this->drupalGet(file_create_url($node_file->uri));
       $this->assertResponse(200, 'Confirmed that the generated URL is correct by downloading the shipped file.');
@@ -877,6 +886,7 @@ class FileFieldDisplayTestCase extends FileFieldTestCase {
     $field_settings = array(
       'display_field' => '1',
       'display_default' => '1',
+      'cardinality' => FIELD_CARDINALITY_UNLIMITED,
     );
     $instance_settings = array(
       'description_field' => '1',
@@ -917,6 +927,17 @@ class FileFieldDisplayTestCase extends FileFieldTestCase {
 
     $this->assertNoRaw($default_output, 'Field is hidden when "display" option is unchecked.');
 
+    // Test that fields appear as expected during the preview.
+    // Add a second file.
+    $name = 'files[' . $field_name . '_' . LANGUAGE_NONE . '_1]';
+    $edit[$name] = drupal_realpath($test_file->uri);
+
+    // Uncheck the display checkboxes and go to the preview.
+    $edit[$field_name . '[' . LANGUAGE_NONE . '][0][display]'] = FALSE;
+    $edit[$field_name . '[' . LANGUAGE_NONE . '][1][display]'] = FALSE;
+    $this->drupalPost('node/' . $nid . '/edit', $edit, t('Preview'));
+    $this->assertRaw($field_name . '[' . LANGUAGE_NONE . '][0][display]', 'First file appears as expected.');
+    $this->assertRaw($field_name . '[' . LANGUAGE_NONE . '][1][display]', 'Second file appears as expected.');
   }
 }
 
diff --git a/drupal7/modules/file/tests/file_module_test.info b/drupal7/modules/file/tests/file_module_test.info
index f55d2ea4..5366340e 100644
--- a/drupal7/modules/file/tests/file_module_test.info
+++ b/drupal7/modules/file/tests/file_module_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/filter/filter.info b/drupal7/modules/filter/filter.info
index 95b804d9..f59a86c0 100644
--- a/drupal7/modules/filter/filter.info
+++ b/drupal7/modules/filter/filter.info
@@ -7,8 +7,8 @@ files[] = filter.test
 required = TRUE
 configure = admin/config/content/formats
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/filter/filter.module b/drupal7/modules/filter/filter.module
index 5c2b8c97..74621f10 100644
--- a/drupal7/modules/filter/filter.module
+++ b/drupal7/modules/filter/filter.module
@@ -348,9 +348,7 @@ function filter_permission() {
   foreach (filter_formats() as $format) {
     $permission = filter_permission_name($format);
     if (!empty($permission)) {
-      // Only link to the text format configuration page if the user who is
-      // viewing this will have access to that page.
-      $format_name_replacement = user_access('administer filters') ? l($format->name, 'admin/config/content/formats/' . $format->format) : drupal_placeholder($format->name);
+      $format_name_replacement = l($format->name, 'admin/config/content/formats/' . $format->format);
       $perms[$permission] = array(
         'title' => t("Use the !text_format text format", array('!text_format' => $format_name_replacement,)),
         'description' => drupal_placeholder(t('Warning: This permission may have security implications depending on how the text format is configured.')),
diff --git a/drupal7/modules/forum/forum.info b/drupal7/modules/forum/forum.info
index e33b24c4..b7d518c3 100644
--- a/drupal7/modules/forum/forum.info
+++ b/drupal7/modules/forum/forum.info
@@ -9,8 +9,8 @@ files[] = forum.test
 configure = admin/structure/forum
 stylesheets[all][] = forum.css
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/help/help.info b/drupal7/modules/help/help.info
index 0553ee0d..8e4b2392 100644
--- a/drupal7/modules/help/help.info
+++ b/drupal7/modules/help/help.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = help.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/image/image.info b/drupal7/modules/image/image.info
index db5fa3cf..1e17ac14 100644
--- a/drupal7/modules/image/image.info
+++ b/drupal7/modules/image/image.info
@@ -7,8 +7,8 @@ dependencies[] = file
 files[] = image.test
 configure = admin/config/media/image-styles
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/image/image.module b/drupal7/modules/image/image.module
index a2a0f416..fac8de95 100644
--- a/drupal7/modules/image/image.module
+++ b/drupal7/modules/image/image.module
@@ -1027,7 +1027,15 @@ function image_style_url($style_name, $path) {
   // The token query is added even if the 'image_allow_insecure_derivatives'
   // variable is TRUE, so that the emitted links remain valid if it is changed
   // back to the default FALSE.
-  $token_query = array(IMAGE_DERIVATIVE_TOKEN => image_style_path_token($style_name, $original_uri));
+  // However, sites which need to prevent the token query from being emitted at
+  // all can additionally set the 'image_suppress_itok_output' variable to TRUE
+  // to achieve that (if both are set, the security token will neither be
+  // emitted in the image derivative URL nor checked for in
+  // image_style_deliver()).
+  $token_query = array();
+  if (!variable_get('image_suppress_itok_output', FALSE)) {
+    $token_query = array(IMAGE_DERIVATIVE_TOKEN => image_style_path_token($style_name, $original_uri));
+  }
 
   // If not using clean URLs, the image derivative callback is only available
   // with the query string. If the file does not exist, use url() to ensure
@@ -1039,8 +1047,12 @@ function image_style_url($style_name, $path) {
   }
 
   $file_url = file_create_url($uri);
-  // Append the query string with the token.
-  return $file_url . (strpos($file_url, '?') !== FALSE ? '&' : '?') . drupal_http_build_query($token_query);
+  // Append the query string with the token, if necessary.
+  if ($token_query) {
+    $file_url .= (strpos($file_url, '?') !== FALSE ? '&' : '?') . drupal_http_build_query($token_query);
+  }
+
+  return $file_url;
 }
 
 /**
diff --git a/drupal7/modules/image/image.test b/drupal7/modules/image/image.test
index 2387314c..35919794 100644
--- a/drupal7/modules/image/image.test
+++ b/drupal7/modules/image/image.test
@@ -330,6 +330,15 @@ class ImageStylesPathAndUrlTestCase extends DrupalWebTestCase {
     $this->drupalGet($nested_url);
     $this->assertResponse(200, 'Image was accessible when a correct token was provided in the URL.');
 
+    // Suppress the security token in the URL, then get the URL of a file. Check
+    // that the security token is not present in the URL but that the image is
+    // still accessible.
+    variable_set('image_suppress_itok_output', TRUE);
+    $generate_url = image_style_url($this->style_name, $original_uri);
+    $this->assertIdentical(strpos($generate_url, IMAGE_DERIVATIVE_TOKEN . '='), FALSE, 'The security token does not appear in the image style URL.');
+    $this->drupalGet($generate_url);
+    $this->assertResponse(200, 'Image was accessible at the URL with a missing token.');
+
     // Check that requesting a nonexistent image does not create any new
     // directories in the file system.
     $directory = $scheme . '://styles/' . $this->style_name . '/' . $scheme . '/' . $this->randomName();
diff --git a/drupal7/modules/image/tests/image_module_test.info b/drupal7/modules/image/tests/image_module_test.info
index 5dc38de9..d382a738 100644
--- a/drupal7/modules/image/tests/image_module_test.info
+++ b/drupal7/modules/image/tests/image_module_test.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = image_module_test.module
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/locale/locale.admin.inc b/drupal7/modules/locale/locale.admin.inc
index b736f79b..e813962d 100644
--- a/drupal7/modules/locale/locale.admin.inc
+++ b/drupal7/modules/locale/locale.admin.inc
@@ -1139,11 +1139,11 @@ function locale_translate_edit_form($form, &$form_state, $lid) {
     '#value' => $source->location
   );
 
-  // Include default form controls with empty values for all languages.
-  // This ensures that the languages are always in the same order in forms.
+  // Include both translated and not yet translated target languages in the
+  // list. The source language is English for built-in strings and the default
+  // language for other strings.
   $languages = language_list();
   $default = language_default();
-  // We don't need the default language value, that value is in $source.
   $omit = $source->textgroup == 'default' ? 'en' : $default->language;
   unset($languages[($omit)]);
   $form['translations'] = array('#tree' => TRUE);
diff --git a/drupal7/modules/locale/locale.info b/drupal7/modules/locale/locale.info
index f4817d42..7431c7b3 100644
--- a/drupal7/modules/locale/locale.info
+++ b/drupal7/modules/locale/locale.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = locale.test
 configure = admin/config/regional/language
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/locale/locale.test b/drupal7/modules/locale/locale.test
index 9ffec9f1..90865872 100644
--- a/drupal7/modules/locale/locale.test
+++ b/drupal7/modules/locale/locale.test
@@ -1202,7 +1202,7 @@ EOF;
    * Helper function that returns a .po file with context.
    */
   function getPoFileWithContext() {
-    // Croatian (code hr) is one the the languages that have a different
+    // Croatian (code hr) is one of the languages that have a different
     // form for the full name and the abbreviated name for the month May.
     return <<< EOF
 msgid ""
diff --git a/drupal7/modules/locale/tests/locale_test.info b/drupal7/modules/locale/tests/locale_test.info
index 6339704d..5391d65f 100644
--- a/drupal7/modules/locale/tests/locale_test.info
+++ b/drupal7/modules/locale/tests/locale_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/menu/menu.info b/drupal7/modules/menu/menu.info
index 243b431e..4c8f89fc 100644
--- a/drupal7/modules/menu/menu.info
+++ b/drupal7/modules/menu/menu.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = menu.test
 configure = admin/structure/menu
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/node/node.api.php b/drupal7/modules/node/node.api.php
index a83dee94..9a4d0959 100644
--- a/drupal7/modules/node/node.api.php
+++ b/drupal7/modules/node/node.api.php
@@ -1299,6 +1299,10 @@ function hook_validate($node, $form, &$form_state) {
  *   The node to be displayed, as returned by node_load().
  * @param $view_mode
  *   View mode, e.g. 'full', 'teaser', ...
+ * @param $langcode
+ *   (optional) A language code to use for rendering. Defaults to the global
+ *   content language of the current request.
+ *
  * @return
  *   The passed $node parameter should be modified as necessary and returned so
  *   it can be properly presented. Nodes are prepared for display by assembling
@@ -1312,7 +1316,7 @@ function hook_validate($node, $form, &$form_state) {
  *
  * @ingroup node_api_hooks
  */
-function hook_view($node, $view_mode) {
+function hook_view($node, $view_mode, $langcode = NULL) {
   if ($view_mode == 'full' && node_is_page($node)) {
     $breadcrumb = array();
     $breadcrumb[] = l(t('Home'), NULL);
diff --git a/drupal7/modules/node/node.info b/drupal7/modules/node/node.info
index 27aa982f..c91b28ac 100644
--- a/drupal7/modules/node/node.info
+++ b/drupal7/modules/node/node.info
@@ -9,8 +9,8 @@ required = TRUE
 configure = admin/structure/types
 stylesheets[all][] = node.css
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/node/node.module b/drupal7/modules/node/node.module
index dbb1a650..fd848e24 100644
--- a/drupal7/modules/node/node.module
+++ b/drupal7/modules/node/node.module
@@ -506,7 +506,8 @@ function node_type_load($name) {
  *   - custom: TRUE or FALSE indicating whether this type is defined by a module
  *     (FALSE) or by a user (TRUE) via Add Content Type.
  *   - modified: TRUE or FALSE indicating whether this type has been modified by
- *     an administrator. Currently not used in any way.
+ *     an administrator. When modifying an existing node type, set to TRUE, or
+ *     the change will be ignored on node_types_rebuild().
  *   - locked: TRUE or FALSE indicating whether the administrator can change the
  *     machine name of this type.
  *   - disabled: TRUE or FALSE indicating whether this type has been disabled.
@@ -739,11 +740,9 @@ function _node_types_build($rebuild = FALSE) {
     $type_db = $type_object->type;
     // Original disabled value.
     $disabled = $type_object->disabled;
-    // Check for node types from disabled modules and mark their types for removal.
-    // Types defined by the node module in the database (rather than by a separate
-    // module using hook_node_info) have a base value of 'node_content'. The isset()
-    // check prevents errors on old (pre-Drupal 7) databases.
-    if (isset($type_object->base) && $type_object->base != 'node_content' && empty($_node_types->types[$type_db])) {
+    // Check for node types either from disabled modules or otherwise not defined
+    // and mark as disabled.
+    if (empty($type_object->custom) && empty($_node_types->types[$type_db])) {
       $type_object->disabled = TRUE;
     }
     if (isset($_node_types->types[$type_db])) {
@@ -1580,9 +1579,7 @@ function node_permission() {
     ),
     'access content overview' => array(
       'title' => t('Access the content overview page'),
-      'description' => user_access('access content overview')
-        ? t('Get an overview of <a href="@url">all content</a>.', array('@url' => url('admin/content')))
-        : t('Get an overview of all content.'),
+      'description' => t('Get an overview of <a href="@url">all content</a>.', array('@url' => url('admin/content'))),
     ),
     'access content' => array(
       'title' => t('View published content'),
@@ -1610,7 +1607,7 @@ function node_permission() {
 }
 
 /**
- * Gathers the rankings from the the hook_ranking() implementations.
+ * Gathers the rankings from the hook_ranking() implementations.
  *
  * @param $query
  *   A query object that has been extended with the Search DB Extender.
diff --git a/drupal7/modules/node/node.pages.inc b/drupal7/modules/node/node.pages.inc
index 62674636..cc3908e3 100644
--- a/drupal7/modules/node/node.pages.inc
+++ b/drupal7/modules/node/node.pages.inc
@@ -371,35 +371,38 @@ function node_form_build_preview($form, &$form_state) {
  * @see node_form_build_preview()
  */
 function node_preview($node) {
-  if (node_access('create', $node) || node_access('update', $node)) {
-    _field_invoke_multiple('load', 'node', array($node->nid => $node));
+  // Clone the node before previewing it to prevent the node itself from being
+  // modified.
+  $cloned_node = clone $node;
+  if (node_access('create', $cloned_node) || node_access('update', $cloned_node)) {
+    _field_invoke_multiple('load', 'node', array($cloned_node->nid => $cloned_node));
     // Load the user's name when needed.
-    if (isset($node->name)) {
+    if (isset($cloned_node->name)) {
       // The use of isset() is mandatory in the context of user IDs, because
       // user ID 0 denotes the anonymous user.
-      if ($user = user_load_by_name($node->name)) {
-        $node->uid = $user->uid;
-        $node->picture = $user->picture;
+      if ($user = user_load_by_name($cloned_node->name)) {
+        $cloned_node->uid = $user->uid;
+        $cloned_node->picture = $user->picture;
       }
       else {
-        $node->uid = 0; // anonymous user
+        $cloned_node->uid = 0; // anonymous user
       }
     }
-    elseif ($node->uid) {
-      $user = user_load($node->uid);
-      $node->name = $user->name;
-      $node->picture = $user->picture;
+    elseif ($cloned_node->uid) {
+      $user = user_load($cloned_node->uid);
+      $cloned_node->name = $user->name;
+      $cloned_node->picture = $user->picture;
     }
 
-    $node->changed = REQUEST_TIME;
-    $nodes = array($node->nid => $node);
+    $cloned_node->changed = REQUEST_TIME;
+    $nodes = array($cloned_node->nid => $cloned_node);
     field_attach_prepare_view('node', $nodes, 'full');
 
     // Display a preview of the node.
     if (!form_get_errors()) {
-      $node->in_preview = TRUE;
-      $output = theme('node_preview', array('node' => $node));
-      unset($node->in_preview);
+      $cloned_node->in_preview = TRUE;
+      $output = theme('node_preview', array('node' => $cloned_node));
+      unset($cloned_node->in_preview);
     }
     drupal_set_title(t('Preview'), PASS_THROUGH);
 
diff --git a/drupal7/modules/node/tests/node_access_test.info b/drupal7/modules/node/tests/node_access_test.info
index 3d6f0e0a..69362c94 100644
--- a/drupal7/modules/node/tests/node_access_test.info
+++ b/drupal7/modules/node/tests/node_access_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/node/tests/node_access_test.module b/drupal7/modules/node/tests/node_access_test.module
index ec35c41f..7932c552 100644
--- a/drupal7/modules/node/tests/node_access_test.module
+++ b/drupal7/modules/node/tests/node_access_test.module
@@ -211,7 +211,7 @@ function node_access_test_node_insert($node) {
 }
 
 /**
- * Implements hook_nodeapi_update().
+ * Implements hook_node_update().
  */
 function node_access_test_node_update($node) {
   _node_access_test_node_write($node);
diff --git a/drupal7/modules/node/tests/node_test.info b/drupal7/modules/node/tests/node_test.info
index 8051dedc..aa658eaa 100644
--- a/drupal7/modules/node/tests/node_test.info
+++ b/drupal7/modules/node/tests/node_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/node/tests/node_test_exception.info b/drupal7/modules/node/tests/node_test_exception.info
index efca6cc0..42894814 100644
--- a/drupal7/modules/node/tests/node_test_exception.info
+++ b/drupal7/modules/node/tests/node_test_exception.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/openid/openid.info b/drupal7/modules/openid/openid.info
index c37a7660..3acd5dc1 100644
--- a/drupal7/modules/openid/openid.info
+++ b/drupal7/modules/openid/openid.info
@@ -5,8 +5,8 @@ package = Core
 core = 7.x
 files[] = openid.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/openid/tests/openid_test.info b/drupal7/modules/openid/tests/openid_test.info
index 4c0a11b1..c8282754 100644
--- a/drupal7/modules/openid/tests/openid_test.info
+++ b/drupal7/modules/openid/tests/openid_test.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = openid
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/overlay/overlay.info b/drupal7/modules/overlay/overlay.info
index 10b840c6..f1130643 100644
--- a/drupal7/modules/overlay/overlay.info
+++ b/drupal7/modules/overlay/overlay.info
@@ -4,8 +4,8 @@ package = Core
 version = VERSION
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/path/path.info b/drupal7/modules/path/path.info
index 316e2236..8e2b63b9 100644
--- a/drupal7/modules/path/path.info
+++ b/drupal7/modules/path/path.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = path.test
 configure = admin/config/search/path
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/php/php.info b/drupal7/modules/php/php.info
index 4a5f4892..aea13e3b 100644
--- a/drupal7/modules/php/php.info
+++ b/drupal7/modules/php/php.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = php.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/poll/poll.info b/drupal7/modules/poll/poll.info
index 91a452a2..bd0cd896 100644
--- a/drupal7/modules/poll/poll.info
+++ b/drupal7/modules/poll/poll.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = poll.test
 stylesheets[all][] = poll.css
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/profile/profile.info b/drupal7/modules/profile/profile.info
index 3a08c06c..174bbcdb 100644
--- a/drupal7/modules/profile/profile.info
+++ b/drupal7/modules/profile/profile.info
@@ -11,8 +11,8 @@ configure = admin/config/people/profile
 ; See user_system_info_alter().
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/rdf/rdf.info b/drupal7/modules/rdf/rdf.info
index 0dc156c1..8626a8e5 100644
--- a/drupal7/modules/rdf/rdf.info
+++ b/drupal7/modules/rdf/rdf.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = rdf.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/rdf/tests/rdf_test.info b/drupal7/modules/rdf/tests/rdf_test.info
index 070b6096..a59f44d0 100644
--- a/drupal7/modules/rdf/tests/rdf_test.info
+++ b/drupal7/modules/rdf/tests/rdf_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/search/search.extender.inc b/drupal7/modules/search/search.extender.inc
index 67094666..72cea647 100644
--- a/drupal7/modules/search/search.extender.inc
+++ b/drupal7/modules/search/search.extender.inc
@@ -149,6 +149,17 @@ class SearchQuery extends SelectQueryExtender {
     $this->searchExpression = $expression;
     $this->type = $module;
 
+    // Add a search_* tag. This needs to be added before any preExecute methods
+    // for decorated queries are called, as $this->prepared will be set to TRUE
+    // and tags added in the execute method will never get used. For example,
+    // if $query is extended by 'SearchQuery' then 'PagerDefault', the
+    // search-specific tag will be added too late (when preExecute() has
+    // already been called from the PagerDefault extender), and as a
+    // consequence will not be available to hook_query_alter() implementations,
+    // nor will the correct hook_query_TAG_alter() implementations get invoked.
+    // See node_search_execute().
+    $this->addTag('search_' . $module);
+
     return $this;
   }
 
@@ -494,9 +505,8 @@ class SearchQuery extends SelectQueryExtender {
       $this->orderBy('calculated_score', 'DESC');
     }
 
-    // Add tag and useful metadata.
+    // Add useful metadata.
     $this
-      ->addTag('search_' . $this->type)
       ->addMetaData('normalize', $this->normalize)
       ->fields('i', array('type', 'sid'));
 
diff --git a/drupal7/modules/search/search.info b/drupal7/modules/search/search.info
index bce90133..5fae76a7 100644
--- a/drupal7/modules/search/search.info
+++ b/drupal7/modules/search/search.info
@@ -8,8 +8,8 @@ files[] = search.test
 configure = admin/config/search/settings
 stylesheets[all][] = search.css
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/search/search.test b/drupal7/modules/search/search.test
index 19f4e551..5f16db3f 100644
--- a/drupal7/modules/search/search.test
+++ b/drupal7/modules/search/search.test
@@ -2048,6 +2048,47 @@ class SearchNodeAccessTest extends DrupalWebTestCase {
   }
 }
 
+/**
+ * Tests node search with query tags.
+ */
+class SearchNodeTagTest extends DrupalWebTestCase {
+  public $test_user;
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Node search query tags',
+      'description' => 'Tests Node search tags functionality.',
+      'group' => 'Search',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('search', 'search_node_tags');
+    node_access_rebuild();
+
+    // Create a test user and log in.
+    $this->test_user = $this->drupalCreateUser(array('search content'));
+    $this->drupalLogin($this->test_user);
+  }
+
+  /**
+   * Tests that the correct tags are available and hooks invoked.
+   */
+  function testNodeSearchQueryTags() {
+    $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => 'testing testing testing.')))));
+
+    // Update the search index.
+    module_invoke_all('update_index');
+    search_update_totals();
+
+    $edit = array('keys' => 'testing');
+    $this->drupalPost('search/node', $edit, t('Search'));
+
+    $this->assertTrue(variable_get('search_node_tags_test_query_tag', FALSE), 'hook_query_alter() was invoked and the query contained the "search_node" tag.');
+    $this->assertTrue(variable_get('search_node_tags_test_query_tag_hook', FALSE), 'hook_query_search_node_alter() was invoked.');
+  }
+}
+
 /**
  * Tests searching with locale values set.
  */
diff --git a/drupal7/modules/search/tests/search_embedded_form.info b/drupal7/modules/search/tests/search_embedded_form.info
index 6aa3ba24..9b046676 100644
--- a/drupal7/modules/search/tests/search_embedded_form.info
+++ b/drupal7/modules/search/tests/search_embedded_form.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/search/tests/search_extra_type.info b/drupal7/modules/search/tests/search_extra_type.info
index f3758d97..c1fd7758 100644
--- a/drupal7/modules/search/tests/search_extra_type.info
+++ b/drupal7/modules/search/tests/search_extra_type.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/search/tests/search_node_tags.info b/drupal7/modules/search/tests/search_node_tags.info
new file mode 100644
index 00000000..96461af6
--- /dev/null
+++ b/drupal7/modules/search/tests/search_node_tags.info
@@ -0,0 +1,12 @@
+name = "Test search node tags"
+description = "Support module for Node search tags testing."
+package = Testing
+version = VERSION
+core = 7.x
+hidden = TRUE
+
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
+project = "drupal"
+datestamp = "1427943826"
+
diff --git a/drupal7/modules/search/tests/search_node_tags.module b/drupal7/modules/search/tests/search_node_tags.module
new file mode 100644
index 00000000..b66dd9ea
--- /dev/null
+++ b/drupal7/modules/search/tests/search_node_tags.module
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * @file
+ * Dummy module implementing a node search hooks for search module testing.
+ */
+
+
+/**
+ *  Implements hook_query_alter().
+ */
+function search_node_tags_query_alter(QueryAlterableInterface $query) {
+  if ($query->hasTag('search_node')) {
+    variable_set('search_node_tags_test_query_tag', TRUE);
+  }
+}
+
+/**
+ *  Implements hook_query_TAG_alter().
+ */
+function search_node_tags_query_search_node_alter(QueryAlterableInterface $query) {
+  variable_set('search_node_tags_test_query_tag_hook', TRUE);
+}
diff --git a/drupal7/modules/shortcut/shortcut.info b/drupal7/modules/shortcut/shortcut.info
index 1411a06f..7e655299 100644
--- a/drupal7/modules/shortcut/shortcut.info
+++ b/drupal7/modules/shortcut/shortcut.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = shortcut.test
 configure = admin/config/user-interface/shortcut
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/drupal_web_test_case.php b/drupal7/modules/simpletest/drupal_web_test_case.php
index 8ecddb50..271efff3 100644
--- a/drupal7/modules/simpletest/drupal_web_test_case.php
+++ b/drupal7/modules/simpletest/drupal_web_test_case.php
@@ -1769,14 +1769,24 @@ class DrupalWebTestCase extends DrupalTestCase {
   protected function curlExec($curl_options, $redirect = FALSE) {
     $this->curlInitialize();
 
-    // cURL incorrectly handles URLs with a fragment by including the
-    // fragment in the request to the server, causing some web servers
-    // to reject the request citing "400 - Bad Request". To prevent
-    // this, we strip the fragment from the request.
-    // TODO: Remove this for Drupal 8, since fixed in curl 7.20.0.
-    if (!empty($curl_options[CURLOPT_URL]) && strpos($curl_options[CURLOPT_URL], '#')) {
-      $original_url = $curl_options[CURLOPT_URL];
-      $curl_options[CURLOPT_URL] = strtok($curl_options[CURLOPT_URL], '#');
+    if (!empty($curl_options[CURLOPT_URL])) {
+      // Forward XDebug activation if present.
+      if (isset($_COOKIE['XDEBUG_SESSION'])) {
+        $options = drupal_parse_url($curl_options[CURLOPT_URL]);
+        $options += array('query' => array());
+        $options['query'] += array('XDEBUG_SESSION_START' => $_COOKIE['XDEBUG_SESSION']);
+        $curl_options[CURLOPT_URL] = url($options['path'], $options);
+      }
+
+      // cURL incorrectly handles URLs with a fragment by including the
+      // fragment in the request to the server, causing some web servers
+      // to reject the request citing "400 - Bad Request". To prevent
+      // this, we strip the fragment from the request.
+      // TODO: Remove this for Drupal 8, since fixed in curl 7.20.0.
+      if (strpos($curl_options[CURLOPT_URL], '#')) {
+        $original_url = $curl_options[CURLOPT_URL];
+        $curl_options[CURLOPT_URL] = strtok($curl_options[CURLOPT_URL], '#');
+      }
     }
 
     $url = empty($curl_options[CURLOPT_URL]) ? curl_getinfo($this->curlHandle, CURLINFO_EFFECTIVE_URL) : $curl_options[CURLOPT_URL];
diff --git a/drupal7/modules/simpletest/files/image-test-transparent-out-of-range.gif b/drupal7/modules/simpletest/files/image-test-transparent-out-of-range.gif
new file mode 100644
index 00000000..a54df7a9
Binary files /dev/null and b/drupal7/modules/simpletest/files/image-test-transparent-out-of-range.gif differ
diff --git a/drupal7/modules/simpletest/simpletest.info b/drupal7/modules/simpletest/simpletest.info
index b3f78f43..48f4e21f 100644
--- a/drupal7/modules/simpletest/simpletest.info
+++ b/drupal7/modules/simpletest/simpletest.info
@@ -56,8 +56,8 @@ files[] = tests/upgrade/update.trigger.test
 files[] = tests/upgrade/update.field.test
 files[] = tests/upgrade/update.user.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/simpletest.module b/drupal7/modules/simpletest/simpletest.module
index 3103af0e..91f0f906 100644
--- a/drupal7/modules/simpletest/simpletest.module
+++ b/drupal7/modules/simpletest/simpletest.module
@@ -328,25 +328,32 @@ function simpletest_test_get_all() {
       // Also discover PSR-0 test classes, if the PHP version allows it.
       if (version_compare(PHP_VERSION, '5.3') > 0) {
 
-        // Select all PSR-0 classes in the Tests namespace of all modules.
+        // Select all PSR-0 and PSR-4 classes in the Tests namespace of all
+        // modules.
         $system_list = db_query("SELECT name, filename FROM {system}")->fetchAllKeyed();
 
         foreach ($system_list as $name => $filename) {
-          // Build directory in which the test files would reside.
-          $tests_dir = DRUPAL_ROOT . '/' . dirname($filename) . '/lib/Drupal/' . $name . '/Tests';
-          // Scan it for test files if it exists.
-          if (is_dir($tests_dir)) {
-            $files = file_scan_directory($tests_dir, '/.*\.php/');
-            if (!empty($files)) {
-              $basedir = DRUPAL_ROOT . '/' . dirname($filename) . '/lib/';
-              foreach ($files as $file) {
-                // Convert the file name into the namespaced class name.
-                $replacements = array(
-                  '/' => '\\',
-                  $basedir => '',
-                  '.php' => '',
-                );
-                $classes[] = strtr($file->uri, $replacements);
+          $module_dir = DRUPAL_ROOT . '/' . dirname($filename);
+          // Search both the 'lib/Drupal/mymodule' directory (for PSR-0 classes)
+          // and the 'src' directory (for PSR-4 classes).
+          foreach(array('lib/Drupal/' . $name, 'src') as $subdir) {
+            // Build directory in which the test files would reside.
+            $tests_dir = $module_dir . '/' . $subdir . '/Tests';
+            // Scan it for test files if it exists.
+            if (is_dir($tests_dir)) {
+              $files = file_scan_directory($tests_dir, '/.*\.php/');
+              if (!empty($files)) {
+                foreach ($files as $file) {
+                  // Convert the file name into the namespaced class name.
+                  $replacements = array(
+                    '/' => '\\',
+                    $module_dir . '/' => '',
+                    'lib/' => '',
+                    'src/' => 'Drupal\\' . $name . '\\',
+                    '.php' => '',
+                  );
+                  $classes[] = strtr($file->uri, $replacements);
+                }
               }
             }
           }
@@ -406,17 +413,20 @@ function simpletest_classloader_register() {
 
   // Only register PSR-0 class loading if we are on PHP 5.3 or higher.
   if (version_compare(PHP_VERSION, '5.3') > 0) {
-    spl_autoload_register('_simpletest_autoload_psr0');
+    spl_autoload_register('_simpletest_autoload_psr4_psr0');
   }
 }
 
 /**
- * Autoload callback to find PSR-0 test classes.
+ * Autoload callback to find PSR-4 and PSR-0 test classes.
+ *
+ * Looks in the 'src/Tests' and in the 'lib/Drupal/mymodule/Tests' directory of
+ * modules for the class.
  *
  * This will only work on classes where the namespace is of the pattern
  *   "Drupal\$extension\Tests\.."
  */
-function _simpletest_autoload_psr0($class) {
+function _simpletest_autoload_psr4_psr0($class) {
 
   // Static cache for extension paths.
   // This cache is lazily filled as soon as it is needed.
@@ -446,14 +456,26 @@ function _simpletest_autoload_psr0($class) {
         $namespace = substr($class, 0, $nspos);
         $classname = substr($class, $nspos + 1);
 
-        // Build the filepath where we expect the class to be defined.
-        $path = dirname($extensions[$extension]) . '/lib/' .
-          str_replace('\\', '/', $namespace) . '/' .
+        // Try the PSR-4 location first, and the PSR-0 location as a fallback.
+        // Build the PSR-4 filepath where we expect the class to be defined.
+        $psr4_path = dirname($extensions[$extension]) . '/src/' .
+          str_replace('\\', '/', substr($namespace, strlen('Drupal\\' . $extension . '\\'))) . '/' .
           str_replace('_', '/', $classname) . '.php';
 
         // Include the file, if it does exist.
-        if (file_exists($path)) {
-          include $path;
+        if (file_exists($psr4_path)) {
+          include $psr4_path;
+        }
+        else {
+          // Build the PSR-0 filepath where we expect the class to be defined.
+          $psr0_path = dirname($extensions[$extension]) . '/lib/' .
+            str_replace('\\', '/', $namespace) . '/' .
+            str_replace('_', '/', $classname) . '.php';
+
+          // Include the file, if it does exist.
+          if (file_exists($psr0_path)) {
+            include $psr0_path;
+          }
         }
       }
     }
diff --git a/drupal7/modules/simpletest/simpletest.test b/drupal7/modules/simpletest/simpletest.test
index dde162ec..f22ef955 100644
--- a/drupal7/modules/simpletest/simpletest.test
+++ b/drupal7/modules/simpletest/simpletest.test
@@ -703,7 +703,9 @@ class SimpleTestDiscoveryTestCase extends DrupalWebTestCase {
     $classes_all = simpletest_test_get_all();
     foreach (array(
       'Drupal\\simpletest\\Tests\\PSR0WebTest',
+      'Drupal\\simpletest\\Tests\\PSR4WebTest',
       'Drupal\\psr_0_test\\Tests\\ExampleTest',
+      'Drupal\\psr_4_test\\Tests\\ExampleTest',
     ) as $class) {
       $this->assert(!empty($classes_all['SimpleTest'][$class]), t('Class @class must be discovered by simpletest_test_get_all().', array('@class' => $class)));
     }
@@ -726,15 +728,20 @@ class SimpleTestDiscoveryTestCase extends DrupalWebTestCase {
       // Don't expect PSR-0 tests to be discovered on older PHP versions.
       return;
     }
-    // This one is provided by simpletest itself via PSR-0.
+    // These are provided by simpletest itself via PSR-0 and PSR-4.
     $this->assertText('PSR0 web test');
+    $this->assertText('PSR4 web test');
     $this->assertText('PSR0 example test: PSR-0 in disabled modules.');
+    $this->assertText('PSR4 example test: PSR-4 in disabled modules.');
     $this->assertText('PSR0 example test: PSR-0 in nested subfolders.');
+    $this->assertText('PSR4 example test: PSR-4 in nested subfolders.');
 
     // Test each test individually.
     foreach (array(
       'Drupal\\psr_0_test\\Tests\\ExampleTest',
       'Drupal\\psr_0_test\\Tests\\Nested\\NestedExampleTest',
+      'Drupal\\psr_4_test\\Tests\\ExampleTest',
+      'Drupal\\psr_4_test\\Tests\\Nested\\NestedExampleTest',
     ) as $class) {
       $this->drupalGet('admin/config/development/testing');
       $edit = array($class => TRUE);
diff --git a/drupal7/modules/simpletest/src/Tests/PSR4WebTest.php b/drupal7/modules/simpletest/src/Tests/PSR4WebTest.php
new file mode 100644
index 00000000..24c8d899
--- /dev/null
+++ b/drupal7/modules/simpletest/src/Tests/PSR4WebTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\simpletest\Tests;
+
+class PSR4WebTest extends \DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'PSR4 web test',
+      'description' => 'We want to assert that this PSR-4 test case is being discovered.',
+      'group' => 'SimpleTest',
+    );
+  }
+
+  function testArithmetics() {
+    $this->assert(1 + 1 == 2, '1 + 1 == 2');
+  }
+}
diff --git a/drupal7/modules/simpletest/tests/actions_loop_test.info b/drupal7/modules/simpletest/tests/actions_loop_test.info
index 8c9290b6..023dd086 100644
--- a/drupal7/modules/simpletest/tests/actions_loop_test.info
+++ b/drupal7/modules/simpletest/tests/actions_loop_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/ajax.test b/drupal7/modules/simpletest/tests/ajax.test
index c38a325f..afe02306 100644
--- a/drupal7/modules/simpletest/tests/ajax.test
+++ b/drupal7/modules/simpletest/tests/ajax.test
@@ -293,7 +293,7 @@ class AJAXCommandsTestCase extends AJAXTestCase {
     $this->assertCommand($commands, $expected, "'changed' AJAX command (with asterisk) issued with correct selector");
 
     // Tests the 'css' command.
-    $commands = $this->drupalPostAJAX($form_path, $edit, array('op' => t("Set the the '#box' div to be blue.")));
+    $commands = $this->drupalPostAJAX($form_path, $edit, array('op' => t("Set the '#box' div to be blue.")));
     $expected = array(
       'command' => 'css',
       'selector' => '#css_div',
diff --git a/drupal7/modules/simpletest/tests/ajax_forms_test.info b/drupal7/modules/simpletest/tests/ajax_forms_test.info
index 9381926d..c55e0267 100644
--- a/drupal7/modules/simpletest/tests/ajax_forms_test.info
+++ b/drupal7/modules/simpletest/tests/ajax_forms_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/ajax_forms_test.module b/drupal7/modules/simpletest/tests/ajax_forms_test.module
index 260d9112..de2fa0ba 100644
--- a/drupal7/modules/simpletest/tests/ajax_forms_test.module
+++ b/drupal7/modules/simpletest/tests/ajax_forms_test.module
@@ -157,7 +157,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
 
   // Shows the Ajax 'css' command.
   $form['css_command_example'] = array(
-    '#value' => t("Set the the '#box' div to be blue."),
+    '#value' => t("Set the '#box' div to be blue."),
     '#type' => 'submit',
     '#ajax' => array(
       'callback' => 'ajax_forms_test_advanced_commands_css_callback',
diff --git a/drupal7/modules/simpletest/tests/ajax_test.info b/drupal7/modules/simpletest/tests/ajax_test.info
index 5a28d36a..579d08bc 100644
--- a/drupal7/modules/simpletest/tests/ajax_test.info
+++ b/drupal7/modules/simpletest/tests/ajax_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/batch_test.info b/drupal7/modules/simpletest/tests/batch_test.info
index 0932dea0..50613935 100644
--- a/drupal7/modules/simpletest/tests/batch_test.info
+++ b/drupal7/modules/simpletest/tests/batch_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/bootstrap.test b/drupal7/modules/simpletest/tests/bootstrap.test
index 14523f28..ece1cd9e 100644
--- a/drupal7/modules/simpletest/tests/bootstrap.test
+++ b/drupal7/modules/simpletest/tests/bootstrap.test
@@ -153,6 +153,8 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
     $this->drupalGet('', array(), array('If-Modified-Since: ' . $last_modified, 'If-None-Match: ' . $etag));
     $this->assertResponse(200, 'Conditional request returned 200 OK for authenticated user.');
     $this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'), 'Absense of Page was not cached.');
+    $this->assertFalse($this->drupalGetHeader('ETag'), 'ETag HTTP headers are not present for logged in users.');
+    $this->assertFalse($this->drupalGetHeader('Last-Modified'), 'Last-Modified HTTP headers are not present for logged in users.');
   }
 
   /**
@@ -286,6 +288,35 @@ class BootstrapVariableTestCase extends DrupalWebTestCase {
 
 }
 
+/**
+ * Tests the auto-loading behavior of the code registry.
+ */
+class BootstrapAutoloadTestCase extends DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Code registry',
+      'description' => 'Test that the code registry functions correctly.',
+      'group' => 'Bootstrap',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('drupal_autoload_test');
+  }
+
+  /**
+   * Tests that autoloader name matching is not case sensitive.
+   */
+  function testAutoloadCase() {
+    // Test interface autoloader.
+    $this->assertTrue(drupal_autoload_interface('drupalautoloadtestinterface'), 'drupal_autoload_interface() recognizes <em>DrupalAutoloadTestInterface</em> in lower case.');
+    // Test class autoloader.
+    $this->assertTrue(drupal_autoload_class('drupalautoloadtestclass'), 'drupal_autoload_class() recognizes <em>DrupalAutoloadTestClass</em> in lower case.');
+  }
+
+}
+
 /**
  * Test hook_boot() and hook_exit().
  */
diff --git a/drupal7/modules/simpletest/tests/common.test b/drupal7/modules/simpletest/tests/common.test
index b8ad0cca..0f0347fc 100644
--- a/drupal7/modules/simpletest/tests/common.test
+++ b/drupal7/modules/simpletest/tests/common.test
@@ -1440,6 +1440,127 @@ class JavaScriptTestCase extends DrupalWebTestCase {
     $this->assertTrue(strpos($javascript, $inline) > 0, 'Rendered JavaScript footer returns the inline code.');
   }
 
+  /**
+   * Test the 'javascript_always_use_jquery' variable.
+   */
+  function testJavaScriptAlwaysUseJQuery() {
+    // The default front page of the site should use jQuery and other standard
+    // scripts and settings.
+    $this->drupalGet('');
+    $this->assertRaw('misc/jquery.js', 'Default behavior: The front page of the site includes jquery.js.');
+    $this->assertRaw('misc/drupal.js', 'Default behavior: The front page of the site includes drupal.js.');
+    $this->assertRaw('Drupal.settings', 'Default behavior: The front page of the site includes Drupal settings.');
+    $this->assertRaw('basePath', 'Default behavior: The front page of the site includes the basePath Drupal setting.');
+
+    // The default front page should not use jQuery and other standard scripts
+    // and settings when the 'javascript_always_use_jquery' variable is set to
+    // FALSE.
+    variable_set('javascript_always_use_jquery', FALSE);
+    $this->drupalGet('');
+    $this->assertNoRaw('misc/jquery.js', 'When "javascript_always_use_jquery" is FALSE: The front page of the site does not include jquery.js.');
+    $this->assertNoRaw('misc/drupal.js', 'When "javascript_always_use_jquery" is FALSE: The front page of the site does not include drupal.js.');
+    $this->assertNoRaw('Drupal.settings', 'When "javascript_always_use_jquery" is FALSE: The front page of the site does not include Drupal settings.');
+    $this->assertNoRaw('basePath', 'When "javascript_always_use_jquery" is FALSE: The front page of the site does not include the basePath Drupal setting.');
+    variable_del('javascript_always_use_jquery');
+
+    // When only settings have been added via drupal_add_js(), drupal_get_js()
+    // should still return jQuery and other standard scripts and settings.
+    $this->resetStaticVariables();
+    drupal_add_js(array('testJavaScriptSetting' => 'test'), 'setting');
+    $javascript = drupal_get_js();
+    $this->assertTrue(strpos($javascript, 'misc/jquery.js') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when only settings have been added includes jquery.js.');
+    $this->assertTrue(strpos($javascript, 'misc/drupal.js') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when only settings have been added includes drupal.js.');
+    $this->assertTrue(strpos($javascript, 'Drupal.settings') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when only settings have been added includes Drupal.settings.');
+    $this->assertTrue(strpos($javascript, 'basePath') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when only settings have been added includes the basePath Drupal setting.');
+    $this->assertTrue(strpos($javascript, 'testJavaScriptSetting') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when only settings have been added includes the added Drupal settings.');
+
+    // When only settings have been added via drupal_add_js() and the
+    // 'javascript_always_use_jquery' variable is set to FALSE, drupal_get_js()
+    // should not return jQuery and other standard scripts and settings, nor
+    // should it return the requested settings (since they cannot actually be
+    // addded to the page without jQuery).
+    $this->resetStaticVariables();
+    variable_set('javascript_always_use_jquery', FALSE);
+    drupal_add_js(array('testJavaScriptSetting' => 'test'), 'setting');
+    $javascript = drupal_get_js();
+    $this->assertTrue(strpos($javascript, 'misc/jquery.js') === FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when only settings have been added does not include jquery.js.');
+    $this->assertTrue(strpos($javascript, 'misc/drupal.js') === FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when only settings have been added does not include drupal.js.');
+    $this->assertTrue(strpos($javascript, 'Drupal.settings') === FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when only settings have been added does not include Drupal.settings.');
+    $this->assertTrue(strpos($javascript, 'basePath') === FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when only settings have been added does not include the basePath Drupal setting.');
+    $this->assertTrue(strpos($javascript, 'testJavaScriptSetting') === FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when only settings have been added does not include the added Drupal settings.');
+    variable_del('javascript_always_use_jquery');
+
+    // When a regular file has been added via drupal_add_js(), drupal_get_js()
+    // should return jQuery and other standard scripts and settings.
+    $this->resetStaticVariables();
+    drupal_add_js('misc/collapse.js');
+    $javascript = drupal_get_js();
+    $this->assertTrue(strpos($javascript, 'misc/jquery.js') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when a custom JavaScript file has been added includes jquery.js.');
+    $this->assertTrue(strpos($javascript, 'misc/drupal.js') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when a custom JavaScript file has been added includes drupal.js.');
+    $this->assertTrue(strpos($javascript, 'Drupal.settings') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when a custom JavaScript file has been added includes Drupal.settings.');
+    $this->assertTrue(strpos($javascript, 'basePath') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when a custom JavaScript file has been added includes the basePath Drupal setting.');
+    $this->assertTrue(strpos($javascript, 'misc/collapse.js') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when a custom JavaScript file has been added includes the custom file.');
+
+    // When a regular file has been added via drupal_add_js() and the
+    // 'javascript_always_use_jquery' variable is set to FALSE, drupal_get_js()
+    // should still return jQuery and other standard scripts and settings
+    // (since the file is assumed to require jQuery by default).
+    $this->resetStaticVariables();
+    variable_set('javascript_always_use_jquery', FALSE);
+    drupal_add_js('misc/collapse.js');
+    $javascript = drupal_get_js();
+    $this->assertTrue(strpos($javascript, 'misc/jquery.js') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when a custom JavaScript file has been added includes jquery.js.');
+    $this->assertTrue(strpos($javascript, 'misc/drupal.js') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when a custom JavaScript file has been added includes drupal.js.');
+    $this->assertTrue(strpos($javascript, 'Drupal.settings') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when a custom JavaScript file has been added includes Drupal.settings.');
+    $this->assertTrue(strpos($javascript, 'basePath') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when a custom JavaScript file has been added includes the basePath Drupal setting.');
+    $this->assertTrue(strpos($javascript, 'misc/collapse.js') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when a custom JavaScript file has been added includes the custom file.');
+    variable_del('javascript_always_use_jquery');
+
+    // When a file that does not require jQuery has been added via
+    // drupal_add_js(), drupal_get_js() should still return jQuery and other
+    // standard scripts and settings by default.
+    $this->resetStaticVariables();
+    drupal_add_js('misc/collapse.js', array('requires_jquery' => FALSE));
+    $javascript = drupal_get_js();
+    $this->assertTrue(strpos($javascript, 'misc/jquery.js') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when a custom JavaScript file that does not require jQuery has been added includes jquery.js.');
+    $this->assertTrue(strpos($javascript, 'misc/drupal.js') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when a custom JavaScript file that does not require jQuery has been added includes drupal.js.');
+    $this->assertTrue(strpos($javascript, 'Drupal.settings') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when a custom JavaScript file that does not require jQuery has been added includes Drupal.settings.');
+    $this->assertTrue(strpos($javascript, 'basePath') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when a custom JavaScript file that does not require jQuery has been added includes the basePath Drupal setting.');
+    $this->assertTrue(strpos($javascript, 'misc/collapse.js') !== FALSE, 'Default behavior: The JavaScript returned by drupal_get_js() when a custom JavaScript file that does not require jQuery has been added includes the custom file.');
+
+    // When a file that does not require jQuery has been added via
+    // drupal_add_js() and the 'javascript_always_use_jquery' variable is set
+    // to FALSE, drupal_get_js() should not return jQuery and other standard
+    // scripts and setting, but it should still return the requested file.
+    $this->resetStaticVariables();
+    variable_set('javascript_always_use_jquery', FALSE);
+    drupal_add_js('misc/collapse.js', array('requires_jquery' => FALSE));
+    $javascript = drupal_get_js();
+    $this->assertTrue(strpos($javascript, 'misc/jquery.js') === FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when a custom JavaScript file that does not require jQuery has been added does not include jquery.js.');
+    $this->assertTrue(strpos($javascript, 'misc/drupal.js') === FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when a custom JavaScript file that does not require jQuery has been added does not include drupal.js.');
+    $this->assertTrue(strpos($javascript, 'Drupal.settings') === FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when a custom JavaScript file that does not require jQuery has been added does not include Drupal.settings.');
+    $this->assertTrue(strpos($javascript, 'basePath') === FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when a custom JavaScript file that does not require jQuery has been added does not include the basePath Drupal setting.');
+    $this->assertTrue(strpos($javascript, 'misc/collapse.js') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when a custom JavaScript file that does not require jQuery has been added includes the custom file.');
+    variable_del('javascript_always_use_jquery');
+
+    // When 'javascript_always_use_jquery' is set to FALSE and a file that does
+    // not require jQuery is added, followed by one that does, drupal_get_js()
+    // should return jQuery and other standard scripts and settings, in
+    // addition to both of the requested files.
+    $this->resetStaticVariables();
+    variable_set('javascript_always_use_jquery', FALSE);
+    drupal_add_js('misc/collapse.js', array('requires_jquery' => FALSE));
+    drupal_add_js('misc/ajax.js');
+    $javascript = drupal_get_js();
+    $this->assertTrue(strpos($javascript, 'misc/jquery.js') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when at least one custom JavaScript file that requires jQuery has been added includes jquery.js.');
+    $this->assertTrue(strpos($javascript, 'misc/drupal.js') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when at least one custom JavaScript file that requires jQuery has been added includes drupal.js.');
+    $this->assertTrue(strpos($javascript, 'Drupal.settings') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when at least one custom JavaScript file that requires jQuery has been added includes Drupal.settings.');
+    $this->assertTrue(strpos($javascript, 'basePath') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when at least one custom JavaScript file that requires jQuery has been added includes the basePath Drupal setting.');
+    $this->assertTrue(strpos($javascript, 'misc/collapse.js') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when at least one custom JavaScript file that requires jQuery has been added includes the first custom file.');
+    $this->assertTrue(strpos($javascript, 'misc/ajax.js') !== FALSE, 'When "javascript_always_use_jquery" is FALSE: The JavaScript returned by drupal_get_js() when at least one custom JavaScript file that requires jQuery has been added includes the second custom file.');
+    variable_del('javascript_always_use_jquery');
+  }
+
   /**
    * Test drupal_add_js() sets preproccess to false when cache is set to false.
    */
@@ -1668,6 +1789,15 @@ class JavaScriptTestCase extends DrupalWebTestCase {
     $query_string = variable_get('css_js_query_string', '0');
     $this->assertRaw(drupal_get_path('module', 'node') . '/node.js?' . $query_string, 'Query string was appended correctly to js.');
   }
+
+  /**
+   * Resets static variables related to adding JavaScript to a page.
+   */
+  function resetStaticVariables() {
+    drupal_static_reset('drupal_add_js');
+    drupal_static_reset('drupal_add_library');
+    drupal_static_reset('drupal_get_library');
+  }
 }
 
 /**
diff --git a/drupal7/modules/simpletest/tests/common_test.info b/drupal7/modules/simpletest/tests/common_test.info
index 91507769..c267f1db 100644
--- a/drupal7/modules/simpletest/tests/common_test.info
+++ b/drupal7/modules/simpletest/tests/common_test.info
@@ -7,8 +7,8 @@ stylesheets[all][] = common_test.css
 stylesheets[print][] = common_test.print.css
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/common_test_cron_helper.info b/drupal7/modules/simpletest/tests/common_test_cron_helper.info
index 3c8cb57d..bf615512 100644
--- a/drupal7/modules/simpletest/tests/common_test_cron_helper.info
+++ b/drupal7/modules/simpletest/tests/common_test_cron_helper.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/database_test.info b/drupal7/modules/simpletest/tests/database_test.info
index 2b8c4e05..fb55d8e4 100644
--- a/drupal7/modules/simpletest/tests/database_test.info
+++ b/drupal7/modules/simpletest/tests/database_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/database_test.test b/drupal7/modules/simpletest/tests/database_test.test
index 12ddb343..9c533bed 100644
--- a/drupal7/modules/simpletest/tests/database_test.test
+++ b/drupal7/modules/simpletest/tests/database_test.test
@@ -238,7 +238,7 @@ class DatabaseConnectionTestCase extends DatabaseTestCase {
     // Open the default target so we have an object to compare.
     $db1 = Database::getConnection('default', 'default');
 
-    // Try to close the the default connection, then open a new one.
+    // Try to close the default connection, then open a new one.
     Database::closeConnection('default', 'default');
     $db2 = Database::getConnection('default', 'default');
 
@@ -3454,12 +3454,14 @@ class DatabaseTransactionTestCase extends DatabaseTestCase {
   }
 
   /**
-   * Helper method for transaction unit test. This "outer layer" transaction
-   * starts and then encapsulates the "inner layer" transaction. This nesting
-   * is used to evaluate whether the the database transaction API properly
-   * supports nesting. By "properly supports," we mean the outer transaction
-   * continues to exist regardless of what functions are called and whether
-   * those functions start their own transactions.
+   * Helper method for transaction unit test.
+   *
+   * This "outer layer" transaction starts and then encapsulates the
+   * "inner layer" transaction. This nesting is used to evaluate whether the
+   * database transaction API properly supports nesting. By "properly supports,"
+   * we mean the outer transaction continues to exist regardless of what
+   * functions are called and whether those functions start their own
+   * transactions.
    *
    * In contrast, a typical database would commit the outer transaction, start
    * a new transaction for the inner layer, commit the inner layer transaction,
diff --git a/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.info b/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.info
new file mode 100644
index 00000000..46bc0a2c
--- /dev/null
+++ b/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.info
@@ -0,0 +1,14 @@
+name = "Drupal code registry test"
+description = "Support module for testing the code registry."
+files[] = drupal_autoload_test_interface.inc
+files[] = drupal_autoload_test_class.inc
+package = Testing
+version = VERSION
+core = 7.x
+hidden = TRUE
+
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
+project = "drupal"
+datestamp = "1427943826"
+
diff --git a/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module b/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module
new file mode 100644
index 00000000..37aa94eb
--- /dev/null
+++ b/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module
@@ -0,0 +1,6 @@
+<?php
+
+/**
+ * @file
+ * Test module to check code registry.
+ */
diff --git a/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_class.inc b/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_class.inc
new file mode 100644
index 00000000..afd72fe6
--- /dev/null
+++ b/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_class.inc
@@ -0,0 +1,11 @@
+<?php
+
+/**
+ * @file
+ * Test classes for code registry testing.
+ */
+
+/**
+ * This class is empty because we only care if Drupal can find it.
+ */
+class DrupalAutoloadTestClass implements DrupalAutoloadTestInterface {}
diff --git a/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_interface.inc b/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_interface.inc
new file mode 100644
index 00000000..d20ce523
--- /dev/null
+++ b/drupal7/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_interface.inc
@@ -0,0 +1,11 @@
+<?php
+
+/**
+ * @file
+ * Test interfaces for code registry testing.
+ */
+
+/**
+ * This interface is empty because we only care if Drupal can find it.
+ */
+interface DrupalAutoloadTestInterface {}
diff --git a/drupal7/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info b/drupal7/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
index 78e3aa04..0255fcc1 100644
--- a/drupal7/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
+++ b/drupal7/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info b/drupal7/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
index cf937487..3f064ea2 100644
--- a/drupal7/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
+++ b/drupal7/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/entity_cache_test.info b/drupal7/modules/simpletest/tests/entity_cache_test.info
index 931e83c7..910c2963 100644
--- a/drupal7/modules/simpletest/tests/entity_cache_test.info
+++ b/drupal7/modules/simpletest/tests/entity_cache_test.info
@@ -6,8 +6,8 @@ core = 7.x
 dependencies[] = entity_cache_test_dependency
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/entity_cache_test_dependency.info b/drupal7/modules/simpletest/tests/entity_cache_test_dependency.info
index a45b7d6a..e97fd1fe 100644
--- a/drupal7/modules/simpletest/tests/entity_cache_test_dependency.info
+++ b/drupal7/modules/simpletest/tests/entity_cache_test_dependency.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/entity_crud_hook_test.info b/drupal7/modules/simpletest/tests/entity_crud_hook_test.info
index 21801707..57077dd7 100644
--- a/drupal7/modules/simpletest/tests/entity_crud_hook_test.info
+++ b/drupal7/modules/simpletest/tests/entity_crud_hook_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/entity_query_access_test.info b/drupal7/modules/simpletest/tests/entity_query_access_test.info
index 71acab7a..9aab62a2 100644
--- a/drupal7/modules/simpletest/tests/entity_query_access_test.info
+++ b/drupal7/modules/simpletest/tests/entity_query_access_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/error_test.info b/drupal7/modules/simpletest/tests/error_test.info
index 5115966a..f103c4bf 100644
--- a/drupal7/modules/simpletest/tests/error_test.info
+++ b/drupal7/modules/simpletest/tests/error_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/file_test.info b/drupal7/modules/simpletest/tests/file_test.info
index 4e0d548b..dae842c3 100644
--- a/drupal7/modules/simpletest/tests/file_test.info
+++ b/drupal7/modules/simpletest/tests/file_test.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = file_test.module
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/filter_test.info b/drupal7/modules/simpletest/tests/filter_test.info
index b9458da8..1a45d8de 100644
--- a/drupal7/modules/simpletest/tests/filter_test.info
+++ b/drupal7/modules/simpletest/tests/filter_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/form.test b/drupal7/modules/simpletest/tests/form.test
index f90b854c..0bf6c8c6 100644
--- a/drupal7/modules/simpletest/tests/form.test
+++ b/drupal7/modules/simpletest/tests/form.test
@@ -470,6 +470,64 @@ class FormsTestCase extends DrupalWebTestCase {
     $this->drupalPost(NULL, array('checkboxes[one]' => TRUE, 'checkboxes[two]' => TRUE), t('Submit'));
     $this->assertText('An illegal choice has been detected.', 'Input forgery was detected.');
   }
+
+  /**
+   * Tests that submitted values are converted to scalar strings for textfields.
+   */
+  public function testTextfieldStringValue() {
+    // Check multivalued submissions.
+    $multivalue = array('evil' => 'multivalue', 'not so' => 'good');
+    $this->checkFormValue('textfield', $multivalue, '');
+    $this->checkFormValue('password', $multivalue, '');
+    $this->checkFormValue('textarea', $multivalue, '');
+    $this->checkFormValue('machine_name', $multivalue, '');
+    $this->checkFormValue('password_confirm', $multivalue, array('pass1' => '', 'pass2' => ''));
+    // Check integer submissions.
+    $integer = 5;
+    $string = '5';
+    $this->checkFormValue('textfield', $integer, $string);
+    $this->checkFormValue('password', $integer, $string);
+    $this->checkFormValue('textarea', $integer, $string);
+    $this->checkFormValue('machine_name', $integer, $string);
+    $this->checkFormValue('password_confirm', array('pass1' => $integer, 'pass2' => $integer), array('pass1' => $string, 'pass2' => $string));
+    // Check that invalid array keys are ignored for password confirm elements.
+    $this->checkFormValue('password_confirm', array('pass1' => 'test', 'pass2' => 'test', 'extra' => 'invalid'), array('pass1' => 'test', 'pass2' => 'test'));
+  }
+
+  /**
+   * Checks that a given form input value is sanitized to the expected result.
+   *
+   * @param string $element_type
+   *   The form element type. Example: textfield.
+   * @param mixed $input_value
+   *   The submitted user input value for the form element.
+   * @param mixed $expected_value
+   *   The sanitized result value in the form state after calling
+   *   form_builder().
+   */
+  protected function checkFormValue($element_type, $input_value, $expected_value) {
+    $form_id = $this->randomName();
+    $form = array();
+    $form_state = form_state_defaults();
+    $form['op'] = array('#type' => 'submit', '#value' => t('Submit'));
+    $form[$element_type] = array(
+      '#type' => $element_type,
+      '#title' => 'test',
+    );
+
+    $form_state['input'][$element_type] = $input_value;
+    $form_state['input']['form_id'] = $form_id;
+    $form_state['method'] = 'post';
+    $form_state['values'] = array();
+    drupal_prepare_form($form_id, $form, $form_state);
+
+    // This is the main function we want to test: it is responsible for
+    // populating user supplied $form_state['input'] to sanitized
+    // $form_state['values'].
+    form_builder($form_id, $form, $form_state);
+
+    $this->assertIdentical($form_state['values'][$element_type], $expected_value, format_string('Form submission for the "@element_type" element type has been correctly sanitized.', array('@element_type' => $element_type)));
+  }
 }
 
 /**
diff --git a/drupal7/modules/simpletest/tests/form_test.info b/drupal7/modules/simpletest/tests/form_test.info
index 4ea6edaf..2dbcd7a1 100644
--- a/drupal7/modules/simpletest/tests/form_test.info
+++ b/drupal7/modules/simpletest/tests/form_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/image.test b/drupal7/modules/simpletest/tests/image.test
index dc95a6e2..84970221 100644
--- a/drupal7/modules/simpletest/tests/image.test
+++ b/drupal7/modules/simpletest/tests/image.test
@@ -261,6 +261,7 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
    */
   function testManipulations() {
     // If GD isn't available don't bother testing this.
+    module_load_include('inc', 'system', 'image.gd');
     if (!function_exists('image_gd_check_settings') || !image_gd_check_settings()) {
       $this->pass(t('Image manipulations for the GD toolkit were skipped because the GD toolkit is not available.'));
       return;
@@ -379,7 +380,7 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
             array_fill(0, 3, 76) + array(3 => 0),
             array_fill(0, 3, 149) + array(3 => 0),
             array_fill(0, 3, 29) + array(3 => 0),
-            array_fill(0, 3, 0) + array(3 => 127)
+            array_fill(0, 3, 225) + array(3 => 127)
           ),
         ),
       );
@@ -394,11 +395,14 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
           continue 2;
         }
 
-        // Transparent GIFs and the imagefilter function don't work together.
-        // There is a todo in image.gd.inc to correct this.
+        // All images should be converted to truecolor when loaded.
+        $image_truecolor = imageistruecolor($image->resource);
+        $this->assertTrue($image_truecolor, format_string('Image %file after load is a truecolor image.', array('%file' => $file)));
+
         if ($image->info['extension'] == 'gif') {
           if ($op == 'desaturate') {
-            $values['corners'][3] = $this->white;
+            // Transparent GIFs and the imagefilter function don't work together.
+            $values['corners'][3][3] = 0;
           }
         }
 
@@ -451,7 +455,8 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
 
         $directory = file_default_scheme() . '://imagetests';
         file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
-        image_save($image, $directory . '/' . $op . '.' . $image->info['extension']);
+        $file_path = $directory . '/' . $op . '.' . $image->info['extension'];
+        image_save($image, $file_path);
 
         $this->assertTrue($correct_dimensions_real, format_string('Image %file after %action action has proper dimensions.', array('%file' => $file, '%action' => $op)));
         $this->assertTrue($correct_dimensions_object, format_string('Image %file object after %action action is reporting the proper height and width values.', array('%file' => $file, '%action' => $op)));
@@ -460,8 +465,37 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
           $this->assertTrue($correct_colors, format_string('Image %file object after %action action has the correct color placement.', array('%file' => $file, '%action' => $op)));
         }
       }
+
+      // Check that saved image reloads without raising PHP errors.
+      $image_reloaded = image_load($file_path);
     }
+  }
 
+  /**
+   * Tests loading an image whose transparent color index is out of range.
+   */
+  function testTransparentColorOutOfRange() {
+    // This image was generated by taking an initial image with a palette size
+    // of 6 colors, and setting the transparent color index to 6 (one higher
+    // than the largest allowed index), as follows:
+    // @code
+    // $image = imagecreatefromgif('modules/simpletest/files/image-test.gif');
+    // imagecolortransparent($image, 6);
+    // imagegif($image, 'modules/simpletest/files/image-test-transparent-out-of-range.gif');
+    // @endcode
+    // This allows us to test that an image with an out-of-range color index
+    // can be loaded correctly.
+    $file = 'image-test-transparent-out-of-range.gif';
+    $image = image_load(drupal_get_path('module', 'simpletest') . '/files/' . $file);
+
+    if (!$image) {
+      $this->fail(format_string('Could not load image %file.', array('%file' => $file)));
+    }
+    else {
+      // All images should be converted to truecolor when loaded.
+      $image_truecolor = imageistruecolor($image->resource);
+      $this->assertTrue($image_truecolor, format_string('Image %file after load is a truecolor image.', array('%file' => $file)));
+    }
   }
 }
 
diff --git a/drupal7/modules/simpletest/tests/image_test.info b/drupal7/modules/simpletest/tests/image_test.info
index dcb7d50e..483bf1d8 100644
--- a/drupal7/modules/simpletest/tests/image_test.info
+++ b/drupal7/modules/simpletest/tests/image_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/menu_test.info b/drupal7/modules/simpletest/tests/menu_test.info
index 74b0593f..45e0a1ef 100644
--- a/drupal7/modules/simpletest/tests/menu_test.info
+++ b/drupal7/modules/simpletest/tests/menu_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/module_test.info b/drupal7/modules/simpletest/tests/module_test.info
index be45da2a..b71af072 100644
--- a/drupal7/modules/simpletest/tests/module_test.info
+++ b/drupal7/modules/simpletest/tests/module_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/path_test.info b/drupal7/modules/simpletest/tests/path_test.info
index b3ec33f5..93fd2197 100644
--- a/drupal7/modules/simpletest/tests/path_test.info
+++ b/drupal7/modules/simpletest/tests/path_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/psr_0_test/psr_0_test.info b/drupal7/modules/simpletest/tests/psr_0_test/psr_0_test.info
index 15a72303..033c8c5c 100644
--- a/drupal7/modules/simpletest/tests/psr_0_test/psr_0_test.info
+++ b/drupal7/modules/simpletest/tests/psr_0_test/psr_0_test.info
@@ -5,8 +5,8 @@ core = 7.x
 hidden = TRUE
 package = Testing
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/psr_4_test/psr_4_test.info b/drupal7/modules/simpletest/tests/psr_4_test/psr_4_test.info
new file mode 100644
index 00000000..2683c3ff
--- /dev/null
+++ b/drupal7/modules/simpletest/tests/psr_4_test/psr_4_test.info
@@ -0,0 +1,12 @@
+name = PSR-4 Test cases
+description = Test classes to be discovered by simpletest.
+core = 7.x
+
+hidden = TRUE
+package = Testing
+
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
+project = "drupal"
+datestamp = "1427943826"
+
diff --git a/drupal7/modules/simpletest/tests/psr_4_test/psr_4_test.module b/drupal7/modules/simpletest/tests/psr_4_test/psr_4_test.module
new file mode 100644
index 00000000..b3d9bbc7
--- /dev/null
+++ b/drupal7/modules/simpletest/tests/psr_4_test/psr_4_test.module
@@ -0,0 +1 @@
+<?php
diff --git a/drupal7/modules/simpletest/tests/psr_4_test/src/Tests/ExampleTest.php b/drupal7/modules/simpletest/tests/psr_4_test/src/Tests/ExampleTest.php
new file mode 100644
index 00000000..208134cf
--- /dev/null
+++ b/drupal7/modules/simpletest/tests/psr_4_test/src/Tests/ExampleTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\psr_4_test\Tests;
+
+class ExampleTest extends \DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'PSR4 example test: PSR-4 in disabled modules.',
+      'description' => 'We want to assert that this test case is being discovered.',
+      'group' => 'SimpleTest',
+    );
+  }
+
+  function testArithmetics() {
+    $this->assert(1 + 1 == 2, '1 + 1 == 2');
+  }
+}
diff --git a/drupal7/modules/simpletest/tests/psr_4_test/src/Tests/Nested/NestedExampleTest.php b/drupal7/modules/simpletest/tests/psr_4_test/src/Tests/Nested/NestedExampleTest.php
new file mode 100644
index 00000000..ff3ac29d
--- /dev/null
+++ b/drupal7/modules/simpletest/tests/psr_4_test/src/Tests/Nested/NestedExampleTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\psr_4_test\Tests\Nested;
+
+class NestedExampleTest extends \DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'PSR4 example test: PSR-4 in nested subfolders.',
+      'description' => 'We want to assert that this PSR-4 test case is being discovered.',
+      'group' => 'SimpleTest',
+    );
+  }
+
+  function testArithmetics() {
+    $this->assert(1 + 1 == 2, '1 + 1 == 2');
+  }
+}
diff --git a/drupal7/modules/simpletest/tests/requirements1_test.info b/drupal7/modules/simpletest/tests/requirements1_test.info
index ef1f7e97..2d9f9ddc 100644
--- a/drupal7/modules/simpletest/tests/requirements1_test.info
+++ b/drupal7/modules/simpletest/tests/requirements1_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/requirements2_test.info b/drupal7/modules/simpletest/tests/requirements2_test.info
index 9c233c34..3726d039 100644
--- a/drupal7/modules/simpletest/tests/requirements2_test.info
+++ b/drupal7/modules/simpletest/tests/requirements2_test.info
@@ -7,8 +7,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/session_test.info b/drupal7/modules/simpletest/tests/session_test.info
index a7adcaf0..ece374e4 100644
--- a/drupal7/modules/simpletest/tests/session_test.info
+++ b/drupal7/modules/simpletest/tests/session_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/system_dependencies_test.info b/drupal7/modules/simpletest/tests/system_dependencies_test.info
index 9ce864c4..48c20772 100644
--- a/drupal7/modules/simpletest/tests/system_dependencies_test.info
+++ b/drupal7/modules/simpletest/tests/system_dependencies_test.info
@@ -6,8 +6,8 @@ core = 7.x
 hidden = TRUE
 dependencies[] = _missing_dependency
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info b/drupal7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info
index f72da43a..57b2300c 100644
--- a/drupal7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info
+++ b/drupal7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info
@@ -6,8 +6,8 @@ core = 7.x
 hidden = TRUE
 dependencies[] = system_incompatible_core_version_test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/system_incompatible_core_version_test.info b/drupal7/modules/simpletest/tests/system_incompatible_core_version_test.info
index d575363a..5fc14515 100644
--- a/drupal7/modules/simpletest/tests/system_incompatible_core_version_test.info
+++ b/drupal7/modules/simpletest/tests/system_incompatible_core_version_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 5.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info b/drupal7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info
index ac867602..7c5fa2b0 100644
--- a/drupal7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info
+++ b/drupal7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info
@@ -7,8 +7,8 @@ hidden = TRUE
 ; system_incompatible_module_version_test declares version 1.0
 dependencies[] = system_incompatible_module_version_test (>2.0)
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/system_incompatible_module_version_test.info b/drupal7/modules/simpletest/tests/system_incompatible_module_version_test.info
index 42c63655..136dc55b 100644
--- a/drupal7/modules/simpletest/tests/system_incompatible_module_version_test.info
+++ b/drupal7/modules/simpletest/tests/system_incompatible_module_version_test.info
@@ -5,8 +5,8 @@ version = 1.0
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/system_test.info b/drupal7/modules/simpletest/tests/system_test.info
index d8de9348..7ca7e026 100644
--- a/drupal7/modules/simpletest/tests/system_test.info
+++ b/drupal7/modules/simpletest/tests/system_test.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = system_test.module
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/system_test.module b/drupal7/modules/simpletest/tests/system_test.module
index c0eed034..8c443299 100644
--- a/drupal7/modules/simpletest/tests/system_test.module
+++ b/drupal7/modules/simpletest/tests/system_test.module
@@ -78,6 +78,13 @@ function system_test_menu() {
     'type' => MENU_CALLBACK,
   );
 
+  $items['system-test/drupal-set-message'] = array(
+    'title' => 'Set messages with drupal_set_message()',
+    'page callback' => 'system_test_drupal_set_message',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+
   $items['system-test/main-content-handling'] = array(
     'title' => 'Test main content handling',
     'page callback' => 'system_test_main_content_fallback',
@@ -435,6 +442,20 @@ function system_test_authorize_init_page($page_title) {
   drupal_goto($authorize_url);
 }
 
+/**
+ * Sets two messages and removes the first one before the messages are displayed.
+ */
+function system_test_drupal_set_message() {
+  // Set two messages.
+  drupal_set_message('First message (removed).');
+  drupal_set_message('Second message (not removed).');
+
+  // Remove the first.
+  unset($_SESSION['messages']['status'][0]);
+
+  return '';
+}
+
 /**
  * Page callback to print out $_GET['destination'] for testing.
  */
diff --git a/drupal7/modules/simpletest/tests/taxonomy_test.info b/drupal7/modules/simpletest/tests/taxonomy_test.info
index d9fe15cf..2e204b53 100644
--- a/drupal7/modules/simpletest/tests/taxonomy_test.info
+++ b/drupal7/modules/simpletest/tests/taxonomy_test.info
@@ -6,8 +6,8 @@ core = 7.x
 hidden = TRUE
 dependencies[] = taxonomy
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/theme.test b/drupal7/modules/simpletest/tests/theme.test
index f1a743e0..f5ddfa9b 100644
--- a/drupal7/modules/simpletest/tests/theme.test
+++ b/drupal7/modules/simpletest/tests/theme.test
@@ -155,6 +155,15 @@ class ThemeTestCase extends DrupalWebTestCase {
     $this->assertNotEqual(theme_get_setting('subtheme_override', 'test_basetheme'), theme_get_setting('subtheme_override', 'test_subtheme'), 'Base theme\'s default settings values can be overridden by subtheme.');
     $this->assertIdentical(theme_get_setting('basetheme_only', 'test_subtheme'), 'base theme value', 'Base theme\'s default settings values are inherited by subtheme.');
   }
+
+  /**
+   * Test the drupal_add_region_content() function.
+   */
+  function testDrupalAddRegionContent() {
+    $this->drupalGet('theme-test/drupal-add-region-content');
+    $this->assertText('Hello');
+    $this->assertText('World');
+  }
 }
 
 /**
diff --git a/drupal7/modules/simpletest/tests/theme_test.info b/drupal7/modules/simpletest/tests/theme_test.info
index 2d20d110..6e0a5c16 100644
--- a/drupal7/modules/simpletest/tests/theme_test.info
+++ b/drupal7/modules/simpletest/tests/theme_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/theme_test.module b/drupal7/modules/simpletest/tests/theme_test.module
index 61a12bb7..948d8175 100644
--- a/drupal7/modules/simpletest/tests/theme_test.module
+++ b/drupal7/modules/simpletest/tests/theme_test.module
@@ -53,6 +53,11 @@ function theme_test_menu() {
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
   );
+  $items['theme-test/drupal-add-region-content'] = array(
+    'page callback' => '_theme_test_drupal_add_region_content',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
   return $items;
 }
 
@@ -126,6 +131,14 @@ function _theme_test_suggestion() {
   return theme(array('theme_test__suggestion', 'theme_test'), array());
 }
 
+/**
+ * Page callback, calls drupal_add_region_content.
+ */
+function _theme_test_drupal_add_region_content() {
+  drupal_add_region_content('content', 'World');
+  return 'Hello';
+}
+
 /**
  * Theme function for testing theme('theme_test_foo').
  */
diff --git a/drupal7/modules/simpletest/tests/themes/test_basetheme/test_basetheme.info b/drupal7/modules/simpletest/tests/themes/test_basetheme/test_basetheme.info
index 778e369e..cf301ad1 100644
--- a/drupal7/modules/simpletest/tests/themes/test_basetheme/test_basetheme.info
+++ b/drupal7/modules/simpletest/tests/themes/test_basetheme/test_basetheme.info
@@ -6,8 +6,8 @@ hidden = TRUE
 settings[basetheme_only] = base theme value
 settings[subtheme_override] = base theme value
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/themes/test_subtheme/test_subtheme.info b/drupal7/modules/simpletest/tests/themes/test_subtheme/test_subtheme.info
index c204766a..f2fcf5c0 100644
--- a/drupal7/modules/simpletest/tests/themes/test_subtheme/test_subtheme.info
+++ b/drupal7/modules/simpletest/tests/themes/test_subtheme/test_subtheme.info
@@ -6,8 +6,8 @@ hidden = TRUE
 
 settings[subtheme_override] = subtheme value
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/themes/test_theme/test_theme.info b/drupal7/modules/simpletest/tests/themes/test_theme/test_theme.info
index 32d4ba50..b4fed8a3 100644
--- a/drupal7/modules/simpletest/tests/themes/test_theme/test_theme.info
+++ b/drupal7/modules/simpletest/tests/themes/test_theme/test_theme.info
@@ -17,8 +17,8 @@ stylesheets[all][] = system.base.css
 
 settings[theme_test_setting] = default value
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/update_script_test.info b/drupal7/modules/simpletest/tests/update_script_test.info
index 24aa5bdf..7d6e4a69 100644
--- a/drupal7/modules/simpletest/tests/update_script_test.info
+++ b/drupal7/modules/simpletest/tests/update_script_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/update_test_1.info b/drupal7/modules/simpletest/tests/update_test_1.info
index 1dc0a674..fb345e7f 100644
--- a/drupal7/modules/simpletest/tests/update_test_1.info
+++ b/drupal7/modules/simpletest/tests/update_test_1.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/update_test_2.info b/drupal7/modules/simpletest/tests/update_test_2.info
index 1dc0a674..fb345e7f 100644
--- a/drupal7/modules/simpletest/tests/update_test_2.info
+++ b/drupal7/modules/simpletest/tests/update_test_2.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/update_test_3.info b/drupal7/modules/simpletest/tests/update_test_3.info
index 1dc0a674..fb345e7f 100644
--- a/drupal7/modules/simpletest/tests/update_test_3.info
+++ b/drupal7/modules/simpletest/tests/update_test_3.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/url_alter_test.info b/drupal7/modules/simpletest/tests/url_alter_test.info
index a7d648b1..4d4f84be 100644
--- a/drupal7/modules/simpletest/tests/url_alter_test.info
+++ b/drupal7/modules/simpletest/tests/url_alter_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/simpletest/tests/xmlrpc_test.info b/drupal7/modules/simpletest/tests/xmlrpc_test.info
index ae9e5daf..1a2df822 100644
--- a/drupal7/modules/simpletest/tests/xmlrpc_test.info
+++ b/drupal7/modules/simpletest/tests/xmlrpc_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/statistics/statistics.admin.inc b/drupal7/modules/statistics/statistics.admin.inc
index e83a115f..f061081e 100644
--- a/drupal7/modules/statistics/statistics.admin.inc
+++ b/drupal7/modules/statistics/statistics.admin.inc
@@ -59,7 +59,7 @@ function statistics_recent_hits() {
  * statistics settings form, but is dependent on cron running.
  *
  * @return
- *   A render array containing information about the the top pages.
+ *   A render array containing information about the top pages.
  */
 function statistics_top_pages() {
   $header = array(
diff --git a/drupal7/modules/statistics/statistics.info b/drupal7/modules/statistics/statistics.info
index 6787d345..38a1dd28 100644
--- a/drupal7/modules/statistics/statistics.info
+++ b/drupal7/modules/statistics/statistics.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = statistics.test
 configure = admin/config/system/statistics
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/syslog/syslog.info b/drupal7/modules/syslog/syslog.info
index c6cbb862..4565bdad 100644
--- a/drupal7/modules/syslog/syslog.info
+++ b/drupal7/modules/syslog/syslog.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = syslog.test
 configure = admin/config/development/logging
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/system/image.gd.inc b/drupal7/modules/system/image.gd.inc
index d9035e4c..913b0de5 100644
--- a/drupal7/modules/system/image.gd.inc
+++ b/drupal7/modules/system/image.gd.inc
@@ -229,7 +229,24 @@ function image_gd_desaturate(stdClass $image) {
 function image_gd_load(stdClass $image) {
   $extension = str_replace('jpg', 'jpeg', $image->info['extension']);
   $function = 'imagecreatefrom' . $extension;
-  return (function_exists($function) && $image->resource = $function($image->source));
+  if (function_exists($function) && $image->resource = $function($image->source)) {
+    if (imageistruecolor($image->resource)) {
+      return TRUE;
+    }
+    else {
+      // Convert indexed images to truecolor, copying the image to a new
+      // truecolor resource, so that filters work correctly and don't result
+      // in unnecessary dither.
+      $resource = image_gd_create_tmp($image, $image->info['width'], $image->info['height']);
+      if ($resource) {
+        imagecopy($resource, $image->resource, 0, 0, 0, 0, imagesx($resource), imagesy($resource));
+        imagedestroy($image->resource);
+        $image->resource = $resource;
+      }
+    }
+    return (bool) $image->resource;
+  }
+  return FALSE;
 }
 
 /**
@@ -297,17 +314,31 @@ function image_gd_create_tmp(stdClass $image, $width, $height) {
   $res = imagecreatetruecolor($width, $height);
 
   if ($image->info['extension'] == 'gif') {
-    // Grab transparent color index from image resource.
+    // Find out if a transparent color is set, will return -1 if no
+    // transparent color has been defined in the image.
     $transparent = imagecolortransparent($image->resource);
 
     if ($transparent >= 0) {
-      // The original must have a transparent color, allocate to the new image.
-      $transparent_color = imagecolorsforindex($image->resource, $transparent);
-      $transparent = imagecolorallocate($res, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);
-
-      // Flood with our new transparent color.
-      imagefill($res, 0, 0, $transparent);
-      imagecolortransparent($res, $transparent);
+      // Find out the number of colors in the image palette. It will be 0 for
+      // truecolor images.
+      $palette_size = imagecolorstotal($image->resource);
+      if ($palette_size == 0 || $transparent < $palette_size) {
+        // Set the transparent color in the new resource, either if it is a
+        // truecolor image or if the transparent color is part of the palette.
+        // Since the index of the transparency color is a property of the
+        // image rather than of the palette, it is possible that an image
+        // could be created with this index set outside the palette size (see
+        // http://stackoverflow.com/a/3898007).
+        $transparent_color = imagecolorsforindex($image->resource, $transparent);
+        $transparent = imagecolorallocate($res, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);
+
+        // Flood with our new transparent color.
+        imagefill($res, 0, 0, $transparent);
+        imagecolortransparent($res, $transparent);
+      }
+      else {
+        imagefill($res, 0, 0, imagecolorallocate($res, 255, 255, 255));
+      }
     }
   }
   elseif ($image->info['extension'] == 'png') {
diff --git a/drupal7/modules/system/system.admin.inc b/drupal7/modules/system/system.admin.inc
index 22c202c3..0f525c6c 100644
--- a/drupal7/modules/system/system.admin.inc
+++ b/drupal7/modules/system/system.admin.inc
@@ -2646,8 +2646,8 @@ function theme_system_modules_fieldset($variables) {
     }
     $row[] = array('data' => $description, 'class' => array('description'));
     // Display links (such as help or permissions) in their own columns.
-    foreach (array('help', 'permissions', 'configure') as $key) {
-      $row[] = array('data' => drupal_render($module['links'][$key]), 'class' => array($key));
+    foreach (array('help', 'permissions', 'configure') as $link_type) {
+      $row[] = array('data' => drupal_render($module['links'][$link_type]), 'class' => array($link_type));
     }
     $rows[] = $row;
   }
diff --git a/drupal7/modules/system/system.api.php b/drupal7/modules/system/system.api.php
index b60f50de..0af6156a 100644
--- a/drupal7/modules/system/system.api.php
+++ b/drupal7/modules/system/system.api.php
@@ -606,8 +606,8 @@ function hook_cron() {
  * @return
  *   An associative array where the key is the queue name and the value is
  *   again an associative array. Possible keys are:
- *   - 'worker callback': The name of the function to call. It will be called
- *     with one argument, the item created via DrupalQueue::createItem().
+ *   - 'worker callback': A PHP callable to call that is an implementation of
+ *     callback_queue_worker().
  *   - 'time': (optional) How much time Drupal should spend on calling this
  *     worker in seconds. Defaults to 15.
  *   - 'skip on cron': (optional) Set to TRUE to avoid being processed during
@@ -643,6 +643,28 @@ function hook_cron_queue_info_alter(&$queues) {
   $queues['aggregator_feeds']['time'] = 90;
 }
 
+/**
+ * Work on a single queue item.
+ *
+ * Callback for hook_queue_info().
+ *
+ * @param $queue_item_data
+ *   The data that was passed to DrupalQueue::createItem() when the item was
+ *   queued.
+ *
+ * @throws \Exception
+ *   The worker callback may throw an exception to indicate there was a problem.
+ *   The cron process will log the exception, and leave the item in the queue to
+ *   be processed again later.
+ *
+ * @see drupal_cron_run()
+ */
+function callback_queue_worker($queue_item_data) {
+  $node = node_load($queue_item_data);
+  $node->title = 'Updated title';
+  $node->save();
+}
+
 /**
  * Allows modules to declare their own Form API element types and specify their
  * default values.
@@ -1890,9 +1912,8 @@ function hook_init() {
 /**
  * Define image toolkits provided by this module.
  *
- * The file which includes each toolkit's functions must be declared as part of
- * the files array in the module .info file so that the registry will find and
- * parse it.
+ * The file which includes each toolkit's functions must be included in this
+ * hook.
  *
  * The toolkit's functions must be named image_toolkitname_operation().
  * where the operation may be:
diff --git a/drupal7/modules/system/system.info b/drupal7/modules/system/system.info
index de967f89..fc3f30c1 100644
--- a/drupal7/modules/system/system.info
+++ b/drupal7/modules/system/system.info
@@ -12,8 +12,8 @@ files[] = system.test
 required = TRUE
 configure = admin/config/system
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/system/system.install b/drupal7/modules/system/system.install
index 43c7383a..64c989a6 100644
--- a/drupal7/modules/system/system.install
+++ b/drupal7/modules/system/system.install
@@ -2854,7 +2854,14 @@ function system_update_7061(&$sandbox) {
         // We will convert filepaths to URI using the default scheme
         // and stripping off the existing file directory path.
         $file['uri'] = $scheme . preg_replace('!^' . preg_quote($basename) . '!', '', $file['filepath']);
-        $file['uri'] = file_stream_wrapper_uri_normalize($file['uri']);
+        // Normalize the URI but don't call file_stream_wrapper_uri_normalize()
+        // directly, since that is a higher-level API function which invokes
+        // hooks while validating the scheme, and those will not work during
+        // the upgrade. Instead, use a simpler version that just assumes the
+        // scheme from above is already valid.
+        if (($file_uri_scheme = file_uri_scheme($file['uri'])) && ($file_uri_target = file_uri_target($file['uri']))) {
+          $file['uri'] = $file_uri_scheme . '://' . $file_uri_target;
+        }
         unset($file['filepath']);
         // Insert into the file_managed table.
         // Each fid should only be stored once in file_managed.
diff --git a/drupal7/modules/system/system.module b/drupal7/modules/system/system.module
index a2749357..6a6200ea 100644
--- a/drupal7/modules/system/system.module
+++ b/drupal7/modules/system/system.module
@@ -374,6 +374,9 @@ function system_element_info() {
     '#element_validate' => array('form_validate_machine_name'),
     '#theme' => 'textfield',
     '#theme_wrappers' => array('form_element'),
+    // Use the same value callback as for textfields; this ensures that we only
+    // get string values.
+    '#value_callback' => 'form_type_textfield_value',
   );
   $types['password'] = array(
     '#input' => TRUE,
@@ -382,6 +385,9 @@ function system_element_info() {
     '#process' => array('ajax_process_form'),
     '#theme' => 'password',
     '#theme_wrappers' => array('form_element'),
+    // Use the same value callback as for textfields; this ensures that we only
+    // get string values.
+    '#value_callback' => 'form_type_textfield_value',
   );
   $types['password_confirm'] = array(
     '#input' => TRUE,
diff --git a/drupal7/modules/system/system.test b/drupal7/modules/system/system.test
index dcc86e53..3e26bae8 100644
--- a/drupal7/modules/system/system.test
+++ b/drupal7/modules/system/system.test
@@ -2826,6 +2826,35 @@ class SystemValidTokenTest extends DrupalUnitTestCase {
   }
 }
 
+/**
+ * Tests drupal_set_message() and related functions.
+ */
+class DrupalSetMessageTest extends DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Messages',
+      'description' => 'Tests that messages can be displayed using drupal_set_message().',
+      'group' => 'System',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('system_test');
+  }
+
+  /**
+   * Tests setting messages and removing one before it is displayed.
+   */
+  function testSetRemoveMessages() {
+    // The page at system-test/drupal-set-message sets two messages and then
+    // removes the first before it is displayed.
+    $this->drupalGet('system-test/drupal-set-message');
+    $this->assertNoText('First message (removed).');
+    $this->assertText('Second message (not removed).');
+  }
+}
+
 /**
  * Tests confirm form destinations.
  */
diff --git a/drupal7/modules/system/tests/cron_queue_test.info b/drupal7/modules/system/tests/cron_queue_test.info
index 096ecbeb..75eb4aa2 100644
--- a/drupal7/modules/system/tests/cron_queue_test.info
+++ b/drupal7/modules/system/tests/cron_queue_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/taxonomy/taxonomy.api.php b/drupal7/modules/taxonomy/taxonomy.api.php
index b9c23dbf..f3c5022b 100644
--- a/drupal7/modules/taxonomy/taxonomy.api.php
+++ b/drupal7/modules/taxonomy/taxonomy.api.php
@@ -212,7 +212,7 @@ function hook_taxonomy_term_view($term, $view_mode, $langcode) {
  * documentation respectively for details.
  *
  * @param $build
- *   A renderable array representing the node content.
+ *   A renderable array representing the term.
  *
  * @see hook_entity_view_alter()
  */
diff --git a/drupal7/modules/taxonomy/taxonomy.info b/drupal7/modules/taxonomy/taxonomy.info
index 04d3cd6b..0e0f111b 100644
--- a/drupal7/modules/taxonomy/taxonomy.info
+++ b/drupal7/modules/taxonomy/taxonomy.info
@@ -8,8 +8,8 @@ files[] = taxonomy.module
 files[] = taxonomy.test
 configure = admin/structure/taxonomy
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/toolbar/toolbar.info b/drupal7/modules/toolbar/toolbar.info
index 63c5d81f..7aac4b74 100644
--- a/drupal7/modules/toolbar/toolbar.info
+++ b/drupal7/modules/toolbar/toolbar.info
@@ -4,8 +4,8 @@ core = 7.x
 package = Core
 version = VERSION
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/tracker/tracker.info b/drupal7/modules/tracker/tracker.info
index d85d6523..a5cbcc08 100644
--- a/drupal7/modules/tracker/tracker.info
+++ b/drupal7/modules/tracker/tracker.info
@@ -6,8 +6,8 @@ version = VERSION
 core = 7.x
 files[] = tracker.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/translation/tests/translation_test.info b/drupal7/modules/translation/tests/translation_test.info
index 9e302ccb..b12ce1f2 100644
--- a/drupal7/modules/translation/tests/translation_test.info
+++ b/drupal7/modules/translation/tests/translation_test.info
@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/translation/translation.info b/drupal7/modules/translation/translation.info
index d8ff9071..5815c938 100644
--- a/drupal7/modules/translation/translation.info
+++ b/drupal7/modules/translation/translation.info
@@ -6,8 +6,8 @@ version = VERSION
 core = 7.x
 files[] = translation.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/trigger/tests/trigger_test.info b/drupal7/modules/trigger/tests/trigger_test.info
index d0f26885..f0b254b0 100644
--- a/drupal7/modules/trigger/tests/trigger_test.info
+++ b/drupal7/modules/trigger/tests/trigger_test.info
@@ -4,8 +4,8 @@ package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/trigger/trigger.info b/drupal7/modules/trigger/trigger.info
index 37f676e8..18e1e196 100644
--- a/drupal7/modules/trigger/trigger.info
+++ b/drupal7/modules/trigger/trigger.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = trigger.test
 configure = admin/structure/trigger
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/update/tests/aaa_update_test.info b/drupal7/modules/update/tests/aaa_update_test.info
index d728f667..716ecf91 100644
--- a/drupal7/modules/update/tests/aaa_update_test.info
+++ b/drupal7/modules/update/tests/aaa_update_test.info
@@ -4,8 +4,8 @@ package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/update/tests/bbb_update_test.info b/drupal7/modules/update/tests/bbb_update_test.info
index 2f20d60e..3b38ddd5 100644
--- a/drupal7/modules/update/tests/bbb_update_test.info
+++ b/drupal7/modules/update/tests/bbb_update_test.info
@@ -4,8 +4,8 @@ package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/update/tests/ccc_update_test.info b/drupal7/modules/update/tests/ccc_update_test.info
index dd3b1422..f1ce3c27 100644
--- a/drupal7/modules/update/tests/ccc_update_test.info
+++ b/drupal7/modules/update/tests/ccc_update_test.info
@@ -4,8 +4,8 @@ package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info b/drupal7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
index 1e7a2295..17ce0add 100644
--- a/drupal7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
+++ b/drupal7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
@@ -3,8 +3,8 @@ description = Test theme which acts as a base theme for other test subthemes.
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info b/drupal7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
index 0d5720c6..87de3a78 100644
--- a/drupal7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
+++ b/drupal7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
@@ -4,8 +4,8 @@ core = 7.x
 base theme = update_test_basetheme
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/update/tests/update_test.info b/drupal7/modules/update/tests/update_test.info
index 57297e47..ae3f6c2f 100644
--- a/drupal7/modules/update/tests/update_test.info
+++ b/drupal7/modules/update/tests/update_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/update/update.info b/drupal7/modules/update/update.info
index a4add6aa..230a4147 100644
--- a/drupal7/modules/update/update.info
+++ b/drupal7/modules/update/update.info
@@ -6,8 +6,8 @@ core = 7.x
 files[] = update.test
 configure = admin/reports/updates/settings
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/user/tests/user_form_test.info b/drupal7/modules/user/tests/user_form_test.info
index 5bd344a5..e0588111 100644
--- a/drupal7/modules/user/tests/user_form_test.info
+++ b/drupal7/modules/user/tests/user_form_test.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/user/user.api.php b/drupal7/modules/user/user.api.php
index e88c7a97..edc61bd3 100644
--- a/drupal7/modules/user/user.api.php
+++ b/drupal7/modules/user/user.api.php
@@ -327,14 +327,6 @@ function hook_user_logout($account) {
  * The module should format its custom additions for display and add them to the
  * $account->content array.
  *
- * Note that when this hook is invoked, the changes have not yet been written to
- * the database, because a database transaction is still in progress. The
- * transaction is not finalized until the save operation is entirely completed
- * and user_save() goes out of scope. You should not rely on data in the
- * database at this time as it is not updated yet. You should also note that any
- * write/update database queries executed from this hook are also not committed
- * immediately. Check user_save() and db_transaction() for more info.
- *
  * @param $account
  *   The user object on which the operation is being performed.
  * @param $view_mode
diff --git a/drupal7/modules/user/user.info b/drupal7/modules/user/user.info
index 68cf2495..d2de841a 100644
--- a/drupal7/modules/user/user.info
+++ b/drupal7/modules/user/user.info
@@ -9,8 +9,8 @@ required = TRUE
 configure = admin/config/people
 stylesheets[all][] = user.css
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/modules/user/user.install b/drupal7/modules/user/user.install
index 4e1a3c22..b573e72d 100644
--- a/drupal7/modules/user/user.install
+++ b/drupal7/modules/user/user.install
@@ -81,7 +81,7 @@ function user_schema() {
     ),
     'foreign keys' => array(
       'role' => array(
-        'table' => 'roles',
+        'table' => 'role',
         'columns' => array('rid' => 'rid'),
       ),
     ),
@@ -278,7 +278,7 @@ function user_schema() {
         'columns' => array('uid' => 'uid'),
       ),
       'role' => array(
-        'table' => 'roles',
+        'table' => 'role',
         'columns' => array('rid' => 'rid'),
       ),
     ),
@@ -356,11 +356,13 @@ function user_update_dependencies() {
     'filter' => 7000,
   );
 
-  // user_update_7012() uses the file API, which relies on the {file_managed}
-  // table, so it must run after system_update_7034(), which creates that
-  // table.
+  // user_update_7012() uses the file API and inserts records into the
+  // {file_managed} table, so it therefore must run after system_update_7061(),
+  // which inserts files with specific IDs into the table and therefore relies
+  // on the table being empty (otherwise it would accidentally overwrite
+  // existing records).
   $dependencies['user'][7012] = array(
-    'system' => 7034,
+    'system' => 7061,
   );
 
   // user_update_7013() uses the file usage API, which relies on the
diff --git a/drupal7/modules/user/user.module b/drupal7/modules/user/user.module
index bdfd36fa..9637a716 100644
--- a/drupal7/modules/user/user.module
+++ b/drupal7/modules/user/user.module
@@ -32,7 +32,7 @@ define('USER_REGISTER_VISITORS', 1);
 define('USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL', 2);
 
 /**
- * Implement hook_help().
+ * Implements hook_help().
  */
 function user_help($path, $arg) {
   global $user;
@@ -848,6 +848,26 @@ function user_is_blocked($name) {
     ->execute()->fetchObject();
 }
 
+/**
+ * Checks if a user has a role.
+ *
+ * @param int $rid
+ *   A role ID.
+ *
+ * @param object|null $account
+ *   (optional) A user account. Defaults to the current user.
+ *
+ * @return bool
+ *   TRUE if the user has the role, or FALSE if not.
+ */
+function user_has_role($rid, $account = NULL) {
+  if (!$account) {
+    $account = $GLOBALS['user'];
+  }
+
+  return isset($account->roles[$rid]);
+}
+
 /**
  * Implements hook_permission().
  */
diff --git a/drupal7/modules/user/user.pages.inc b/drupal7/modules/user/user.pages.inc
index 6b7d38e2..f21bd134 100644
--- a/drupal7/modules/user/user.pages.inc
+++ b/drupal7/modules/user/user.pages.inc
@@ -359,7 +359,6 @@ function user_cancel_confirm_form($form, &$form_state, $account) {
   $form['_account'] = array('#type' => 'value', '#value' => $account);
 
   // Display account cancellation method selection, if allowed.
-  $default_method = variable_get('user_cancel_method', 'user_cancel_block');
   $admin_access = user_access('administer users');
   $can_select_method = $admin_access || user_access('select account cancellation method');
   $form['user_cancel_method'] = array(
diff --git a/drupal7/profiles/minimal/minimal.info b/drupal7/profiles/minimal/minimal.info
index 423a5804..1b9d8fa7 100644
--- a/drupal7/profiles/minimal/minimal.info
+++ b/drupal7/profiles/minimal/minimal.info
@@ -5,8 +5,8 @@ core = 7.x
 dependencies[] = block
 dependencies[] = dblog
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/profiles/standard/standard.info b/drupal7/profiles/standard/standard.info
index a6427e00..a48955f6 100644
--- a/drupal7/profiles/standard/standard.info
+++ b/drupal7/profiles/standard/standard.info
@@ -24,8 +24,8 @@ dependencies[] = field_ui
 dependencies[] = file
 dependencies[] = rdf
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/profiles/standard/translations/fr.po b/drupal7/profiles/standard/translations/fr.po
index be199755..9c6a9b43 100644
--- a/drupal7/profiles/standard/translations/fr.po
+++ b/drupal7/profiles/standard/translations/fr.po
@@ -1,10 +1,10 @@
-# French translation of Drupal core (7.35)
+# French translation of Drupal core (7.36)
 # Copyright (c) 2015 by the French translation team
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Drupal core (7.35)\n"
-"POT-Creation-Date: 2015-03-18 20:58+0000\n"
+"Project-Id-Version: Drupal core (7.36)\n"
+"POT-Creation-Date: 2015-04-02 05:48+0000\n"
 "PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
 "Language-Team: French\n"
 "MIME-Version: 1.0\n"
@@ -7689,8 +7689,6 @@ msgstr ""
 "page. Cliquez sur le lien <em>Configurer</em> à côté de chaque bloc "
 "pour configurer son titre et ses paramètres de visibilité "
 "spécifiques."
-msgid "Demonstrate block regions (@theme)"
-msgstr "Aperçu des régions des blocs (@theme)"
 msgid "Administer blocks"
 msgstr "Administrer les blocs"
 msgid ""
@@ -16818,8 +16816,6 @@ msgstr ""
 "tentative de création d'un dérivé (%derivative_path)."
 msgid "Get an overview of <a href=\"@url\">all content</a>."
 msgstr "Avoir un aperçu de <a href=\"@url\">tous les contenus</a>."
-msgid "Get an overview of all content."
-msgstr "Avoir un aperçu de tous les contenus."
 msgid "Invalid or missing cache bin specified: %bin"
 msgstr "Le bin de cache spécifié %bin est manquant ou invalide"
 msgid "Caribbean Netherlands"
@@ -16870,6 +16866,8 @@ msgid ""
 msgstr ""
 "Une incohérence de l'identifiant du formulaire a été détectée "
 "lors de la tentative d'enregistrement dans le cache."
+msgid "Demonstrate block regions (!theme)"
+msgstr "Présenter les régions de bloc (!theme)"
 msgid "Search result highlighting input"
 msgstr "Effectuer une recherche en mettant en évidence les données saisies"
 msgid "Link %label does not exist on @url_before"
diff --git a/drupal7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info b/drupal7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
index 037685ff..cce38725 100644
--- a/drupal7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
+++ b/drupal7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
@@ -6,8 +6,8 @@ core = 7.x
 hidden = TRUE
 files[] = drupal_system_listing_compatible_test.test
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info b/drupal7/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
index 4ffd7e5e..25c98dee 100644
--- a/drupal7/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
+++ b/drupal7/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
@@ -8,8 +8,8 @@ version = VERSION
 core = 6.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/profiles/testing/testing.info b/drupal7/profiles/testing/testing.info
index b05d5364..d0e7674a 100644
--- a/drupal7/profiles/testing/testing.info
+++ b/drupal7/profiles/testing/testing.info
@@ -4,8 +4,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/robots.txt b/drupal7/robots.txt
index 6f20eaf3..ff9e2868 100644
--- a/drupal7/robots.txt
+++ b/drupal7/robots.txt
@@ -12,9 +12,6 @@
 #
 # For more information about the robots.txt standard, see:
 # http://www.robotstxt.org/robotstxt.html
-#
-# For syntax checking, see:
-# http://www.frobee.com/robots-txt-check
 
 User-agent: *
 Crawl-delay: 10
diff --git a/drupal7/themes/bartik/bartik.info b/drupal7/themes/bartik/bartik.info
index f57dde1b..72ca64a6 100644
--- a/drupal7/themes/bartik/bartik.info
+++ b/drupal7/themes/bartik/bartik.info
@@ -34,8 +34,8 @@ regions[footer] = Footer
 settings[shortcut_module_link] = 0
 
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/themes/garland/garland.info b/drupal7/themes/garland/garland.info
index 34c238bf..b46364aa 100644
--- a/drupal7/themes/garland/garland.info
+++ b/drupal7/themes/garland/garland.info
@@ -7,8 +7,8 @@ stylesheets[all][] = style.css
 stylesheets[print][] = print.css
 settings[garland_width] = fluid
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/themes/seven/seven.info b/drupal7/themes/seven/seven.info
index e844220e..1eff1ffe 100644
--- a/drupal7/themes/seven/seven.info
+++ b/drupal7/themes/seven/seven.info
@@ -13,8 +13,8 @@ regions[page_bottom] = Page bottom
 regions[sidebar_first] = First sidebar
 regions_hidden[] = sidebar_first
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
diff --git a/drupal7/themes/stark/stark.info b/drupal7/themes/stark/stark.info
index c5b15af0..ac551a07 100644
--- a/drupal7/themes/stark/stark.info
+++ b/drupal7/themes/stark/stark.info
@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 stylesheets[all][] = layout.css
 
-; Information added by Drupal.org packaging script on 2015-03-18
-version = "7.35"
+; Information added by Drupal.org packaging script on 2015-04-02
+version = "7.36"
 project = "drupal"
-datestamp = "1426707463"
+datestamp = "1427943826"
 
