commit b4adf10d495f08ffa1111608ba0e4859743b5dcb
Author: Assos Assos <assos+forge@centrale-marseille.fr>
Date:   Sun Nov 9 11:26:34 2014 +0100

    Udpate to 7.33

diff --git a/drupal7/CHANGELOG.txt b/drupal7/CHANGELOG.txt
index 02c94655..6530aa87 100644
--- a/drupal7/CHANGELOG.txt
+++ b/drupal7/CHANGELOG.txt
@@ -1,4 +1,69 @@
 
+Drupal 7.33, 2014-11-07
+-----------------------
+- Began storing the file modification time of each module and theme in the
+  {system} database table so that contributed modules can use it to identify
+  recently changed modules and themes (minor data structure change to the
+  return value of system_get_info() and other related functions).
+- Added a "Did you mean?" feature to the run-tests.sh script for running
+  automated tests from the command line, to help developers who are attempting
+  to run a particular test class or group.
+- Changed the date format used in various HTTP headers output by Drupal core
+  from RFC 1123 format to RFC 7231 format.
+- Added a "block_cache_bypass_node_grants" variable to allow sites which have
+  node access modules enabled to use the block cache if desired (API addition).
+- Made image derivative generation HTTP requests return a 404 error (rather
+  than a 500 error) when the source image does not exist.
+- Fixed a bug which caused user pictures to be removed from the user object
+  after saving, and resulted in data loss if the user account was subsequently
+  re-saved.
+- Fixed a bug in which field_has_data() did not return TRUE for fields that
+  only had data in older entity revisions, leading to loss of the field's data
+  when the field configuration was edited.
+- Fixed a bug which caused the Ajax progress throbber to appear misaligned in
+  many situatons (minor styling change).
+- Prevented the Bartik theme from lower-casing the "Permalink" link on
+  comments, for improved multilingual support (minor UI change).
+- Added a "preferred_menu_links" tag to the database query that is used by
+  menu_link_get_preferred() to find the preferred menu link for a given path,
+  to make it easier to alter.
+- Increased the maximum allowed length of block titles to 255 characters
+  (database schema change to the {block} table).
+- Removed the Field module's field_modules_uninstalled() function, since it did
+  not do anything when it was invoked.
+- Added a "theme_hook_original" variable to templates and theme functions and
+  an optional sitewide theme debug mode, to provide contextual information in
+  the page's HTML to theme developers. The theme debug mode is based on the one
+  used with Twig in Drupal 8 and can be accessed by setting the "theme_debug"
+  variable to TRUE (API addition).
+- Added an entity_view_mode_prepare() API function to allow entity-defining
+  modules to properly invoke hook_entity_view_mode_alter(), and used it
+  throughout Drupal core to fix bugs with the invocation of that hook (API
+  change: https://www.drupal.org/node/2369141).
+- Security improvement: Made the database API's orderBy() method sanitize the
+  sort direction ("ASC" or "DESC") for queries built with db_select(), so that
+  calling code does not have to.
+- Changed the RDF module to consistently output RDF metadata for nodes and
+  comments near where the node is rendered in the HTML (minor markup and data
+  structure change).
+- Added an HTML class to RDFa metatags throughout Drupal to prevent them from
+  accidentally affecting the site appearance (minor markup change).
+- Fixed a bug in the Unicode requirements check which prevented installing
+  Drupal on PHP 5.6.
+- Fixed a bug which caused drupal_get_bootstrap_phase() to abort the bootstrap
+  when called early in the page request.
+- Renamed the "Search result" view mode to "Search result highlighting input"
+  to better reflect how it is used (UI change).
+- Improved database queries generated by EntityFieldQuery in the case where
+  delta or language condition groups are used, to reduce the number of INNER
+  JOINs (this is a minor data structure change affecting code which implements
+  hook_query_alter() on these queries).
+- Removed special-case behavior for file uploads which allowed user #1 to
+  bypass maximum file size and user quota limits.
+- Numerous small bug fixes.
+- Numerous API documentation improvements.
+- Additional automated test coverage.
+
 Drupal 7.32, 2014-10-15
 ----------------------
 - Fixed security issues (SQL injection). See SA-CORE-2014-005.
diff --git a/drupal7/includes/ajax.inc b/drupal7/includes/ajax.inc
index 8446bf89..10877a24 100644
--- a/drupal7/includes/ajax.inc
+++ b/drupal7/includes/ajax.inc
@@ -276,7 +276,7 @@ function ajax_render($commands = array()) {
 
   $extra_commands = array();
   if (!empty($styles)) {
-    $extra_commands[] = ajax_command_prepend('head', $styles);
+    $extra_commands[] = ajax_command_add_css($styles);
   }
   if (!empty($scripts_header)) {
     $extra_commands[] = ajax_command_prepend('head', $scripts_header);
@@ -292,7 +292,7 @@ function ajax_render($commands = array()) {
   $scripts = drupal_add_js();
   if (!empty($scripts['settings'])) {
     $settings = $scripts['settings'];
-    array_unshift($commands, ajax_command_settings(call_user_func_array('array_merge_recursive', $settings['data']), TRUE));
+    array_unshift($commands, ajax_command_settings(drupal_array_merge_deep_array($settings['data']), TRUE));
   }
 
   // Allow modules to alter any Ajax response.
@@ -1257,3 +1257,26 @@ function ajax_command_update_build_id($form) {
     'new' => $form['#build_id'],
   );
 }
+
+/**
+ * Creates a Drupal Ajax 'add_css' command.
+ *
+ * This method will add css via ajax in a cross-browser compatible way.
+ *
+ * This command is implemented by Drupal.ajax.prototype.commands.add_css()
+ * defined in misc/ajax.js.
+ *
+ * @param $styles
+ *   A string that contains the styles to be added.
+ *
+ * @return
+ *   An array suitable for use with the ajax_render() function.
+ *
+ * @see misc/ajax.js
+ */
+function ajax_command_add_css($styles) {
+  return array(
+    'command' => 'add_css',
+    'data' => $styles,
+  );
+}
diff --git a/drupal7/includes/bootstrap.inc b/drupal7/includes/bootstrap.inc
index c8d17f5d..6fa369d4 100644
--- a/drupal7/includes/bootstrap.inc
+++ b/drupal7/includes/bootstrap.inc
@@ -8,7 +8,7 @@
 /**
  * The current system version.
  */
-define('VERSION', '7.32');
+define('VERSION', '7.33');
 
 /**
  * Core API compatibility.
@@ -248,6 +248,15 @@ define('REGISTRY_WRITE_LOOKUP_CACHE', 2);
  */
 define('DRUPAL_PHP_FUNCTION_PATTERN', '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*');
 
+/**
+ * A RFC7231 Compliant date.
+ *
+ * http://tools.ietf.org/html/rfc7231#section-7.1.1.1
+ *
+ * Example: Sun, 06 Nov 1994 08:49:37 GMT
+ */
+define('DATE_RFC7231', 'D, d M Y H:i:s \G\M\T');
+
 /**
  * Provides a caching wrapper to be used in place of large array structures.
  *
@@ -852,7 +861,7 @@ function drupal_get_filename($type, $name, $filename = NULL) {
     try {
       if (function_exists('db_query')) {
         $file = db_query("SELECT filename FROM {system} WHERE name = :name AND type = :type", array(':name' => $name, ':type' => $type))->fetchField();
-        if (file_exists(DRUPAL_ROOT . '/' . $file)) {
+        if ($file !== FALSE && file_exists(DRUPAL_ROOT . '/' . $file)) {
           $files[$type][$name] = $file;
         }
       }
@@ -1266,7 +1275,7 @@ function drupal_page_header() {
 
   $default_headers = array(
     'Expires' => 'Sun, 19 Nov 1978 05:00:00 GMT',
-    'Last-Modified' => gmdate(DATE_RFC1123, REQUEST_TIME),
+    'Last-Modified' => gmdate(DATE_RFC7231, REQUEST_TIME),
     'Cache-Control' => 'no-cache, must-revalidate, post-check=0, pre-check=0',
     'ETag' => '"' . REQUEST_TIME . '"',
   );
@@ -1336,7 +1345,7 @@ function drupal_serve_page_from_cache(stdClass $cache) {
     drupal_add_http_header($name, $value);
   }
 
-  $default_headers['Last-Modified'] = gmdate(DATE_RFC1123, $cache->created);
+  $default_headers['Last-Modified'] = gmdate(DATE_RFC7231, $cache->created);
 
   // HTTP/1.0 proxies does not support the Vary header, so prevent any caching
   // by sending an Expires date in the past. HTTP/1.1 clients ignores the
@@ -1559,12 +1568,13 @@ function format_string($string, array $args = array()) {
  * Also validates strings as UTF-8 to prevent cross site scripting attacks on
  * Internet Explorer 6.
  *
- * @param $text
+ * @param string $text
  *   The text to be checked or processed.
  *
- * @return
- *   An HTML safe version of $text, or an empty string if $text is not
- *   valid UTF-8.
+ * @return string
+ *   An HTML safe version of $text. If $text is not valid UTF-8, an empty string
+ *   is returned and, on PHP < 5.4, a warning may be issued depending on server
+ *   configuration (see @link https://bugs.php.net/bug.php?id=47494 @endlink).
  *
  * @see drupal_validate_utf8()
  * @ingroup sanitization
@@ -2176,7 +2186,7 @@ function drupal_anonymous_user() {
  *   drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
  * @endcode
  *
- * @param $phase
+ * @param int $phase
  *   A constant telling which phase to bootstrap to. When you bootstrap to a
  *   particular phase, all earlier phases are run automatically. Possible
  *   values:
@@ -2189,11 +2199,11 @@ function drupal_anonymous_user() {
  *   - DRUPAL_BOOTSTRAP_LANGUAGE: Finds out the language of the page.
  *   - DRUPAL_BOOTSTRAP_FULL: Fully loads Drupal. Validates and fixes input
  *     data.
- * @param $new_phase
+ * @param boolean $new_phase
  *   A boolean, set to FALSE if calling drupal_bootstrap from inside a
  *   function called from drupal_bootstrap (recursion).
  *
- * @return
+ * @return int
  *   The most recently completed phase.
  */
 function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
@@ -2215,12 +2225,13 @@ function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
   // bootstrap state.
   static $stored_phase = -1;
 
-  // When not recursing, store the phase name so it's not forgotten while
-  // recursing.
-  if ($new_phase) {
-    $final_phase = $phase;
-  }
   if (isset($phase)) {
+    // When not recursing, store the phase name so it's not forgotten while
+    // recursing but take care of not going backwards.
+    if ($new_phase && $phase >= $stored_phase) {
+      $final_phase = $phase;
+    }
+
     // Call a phase if it has not been called before and is below the requested
     // phase.
     while ($phases && $phase > $stored_phase && $final_phase > $stored_phase) {
@@ -2508,7 +2519,7 @@ function _drupal_bootstrap_page_header() {
  * @see drupal_bootstrap()
  */
 function drupal_get_bootstrap_phase() {
-  return drupal_bootstrap();
+  return drupal_bootstrap(NULL, FALSE);
 }
 
 /**
@@ -3328,11 +3339,9 @@ function registry_update() {
  * @param $default_value
  *   Optional default value.
  * @param $reset
- *   TRUE to reset a specific named variable, or all variables if $name is NULL.
- *   Resetting every variable should only be used, for example, for running
- *   unit tests with a clean environment. Should be used only though via
- *   function drupal_static_reset() and the return value should not be used in
- *   this case.
+ *   TRUE to reset one or all variables(s). This parameter is only used
+ *   internally and should not be passed in; use drupal_static_reset() instead.
+ *   (This function's return value should not be used when TRUE is passed in.)
  *
  * @return
  *   Returns a variable by reference.
@@ -3377,6 +3386,8 @@ function &drupal_static($name, $default_value = NULL, $reset = FALSE) {
  *
  * @param $name
  *   Name of the static variable to reset. Omit to reset all variables.
+ *   Resetting all variables should only be used, for example, for running unit
+ *   tests with a clean environment.
  */
 function drupal_static_reset($name = NULL) {
   drupal_static($name, NULL, TRUE);
diff --git a/drupal7/includes/cache.inc b/drupal7/includes/cache.inc
index 09f4d753..207bf661 100644
--- a/drupal7/includes/cache.inc
+++ b/drupal7/includes/cache.inc
@@ -98,9 +98,11 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
  * @param $data
  *   The data to store in the cache. Complex data types will be automatically
  *   serialized before insertion. Strings will be stored as plain text and are
- *   not serialized.
+ *   not serialized. Some storage engines only allow objects up to a maximum of
+ *   1MB in size to be stored by default. When caching large arrays or similar,
+ *   take care to ensure $data does not exceed this size.
  * @param $bin
- *   The cache bin to store the data in. Valid core values are:
+ *   (optional) The cache bin to store the data in. Valid core values are:
  *   - cache: (default) Generic cache storage bin (used for theme registry,
  *     locale date, list of simpletest tests, etc.).
  *   - cache_block: Stores the content of various blocks.
@@ -119,7 +121,7 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
  *     the administrator panel.
  *   - cache_path: Stores the system paths that have an alias.
  * @param $expire
- *   One of the following values:
+ *   (optional) One of the following values:
  *   - CACHE_PERMANENT: Indicates that the item should never be removed unless
  *     explicitly told to using cache_clear_all() with a cache ID.
  *   - CACHE_TEMPORARY: Indicates that the item should be removed at the next
@@ -254,10 +256,12 @@ interface DrupalCacheInterface {
    *   The cache ID of the data to store.
    * @param $data
    *   The data to store in the cache. Complex data types will be automatically
-   *   serialized before insertion.
-   *   Strings will be stored as plain text and not serialized.
+   *   serialized before insertion. Strings will be stored as plain text and not
+   *   serialized. Some storage engines only allow objects up to a maximum of
+   *   1MB in size to be stored by default. When caching large arrays or
+   *   similar, take care to ensure $data does not exceed this size.
    * @param $expire
-   *   One of the following values:
+   *   (optional) One of the following values:
    *   - CACHE_PERMANENT: Indicates that the item should never be removed unless
    *     explicitly told to using cache_clear_all() with a cache ID.
    *   - CACHE_TEMPORARY: Indicates that the item should be removed at the next
diff --git a/drupal7/includes/common.inc b/drupal7/includes/common.inc
index 477ecc0e..20cc82be 100644
--- a/drupal7/includes/common.inc
+++ b/drupal7/includes/common.inc
@@ -985,9 +985,10 @@ function drupal_http_request($url, array $options = array()) {
   $response = preg_split("/\r\n|\n|\r/", $response);
 
   // Parse the response status line.
-  list($protocol, $code, $status_message) = explode(' ', trim(array_shift($response)), 3);
-  $result->protocol = $protocol;
-  $result->status_message = $status_message;
+  $response_status_array = _drupal_parse_response_status(trim(array_shift($response)));
+  $result->protocol = $response_status_array['http_version'];
+  $result->status_message = $response_status_array['reason_phrase'];
+  $code = $response_status_array['response_code'];
 
   $result->headers = array();
 
@@ -1078,12 +1079,43 @@ function drupal_http_request($url, array $options = array()) {
       }
       break;
     default:
-      $result->error = $status_message;
+      $result->error = $result->status_message;
   }
 
   return $result;
 }
 
+/**
+ * Splits an HTTP response status line into components.
+ *
+ * See the @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html status line definition @endlink
+ * in RFC 2616.
+ *
+ * @param string $respone
+ *   The response status line, for example 'HTTP/1.1 500 Internal Server Error'.
+ *
+ * @return array
+ *   Keyed array containing the component parts. If the response is malformed,
+ *   all possible parts will be extracted. 'reason_phrase' could be empty.
+ *   Possible keys:
+ *   - 'http_version'
+ *   - 'response_code'
+ *   - 'reason_phrase'
+ */
+function _drupal_parse_response_status($response) {
+  $response_array = explode(' ', trim($response), 3);
+  // Set up empty values.
+  $result = array(
+    'reason_phrase' => '',
+  );
+  $result['http_version'] = $response_array[0];
+  $result['response_code'] = $response_array[1];
+  if (isset($response_array[2])) {
+    $result['reason_phrase'] = $response_array[2];
+  }
+  return $result;
+}
+
 /**
  * Helper function for determining hosts excluded from needing a proxy.
  *
@@ -3442,7 +3474,11 @@ function drupal_pre_render_styles($elements) {
             $import_batch = array_slice($import, 0, 31);
             $import = array_slice($import, 31);
             $element = $style_element_defaults;
-            $element['#value'] = implode("\n", $import_batch);
+            // This simplifies the JavaScript regex, allowing each line
+            // (separated by \n) to be treated as a completely different string.
+            // This means that we can use ^ and $ on one line at a time, and not
+            // worry about style tags since they'll never match the regex.
+            $element['#value'] = "\n" . implode("\n", $import_batch) . "\n";
             $element['#attributes']['media'] = $group['media'];
             $element['#browsers'] = $group['browsers'];
             $elements[] = $element;
@@ -3768,7 +3804,7 @@ function _drupal_load_stylesheet($matches) {
   // Alter all internal url() paths. Leave external paths alone. We don't need
   // to normalize absolute paths here (i.e. remove folder/... segments) because
   // that will be done later.
-  return preg_replace('/url\(\s*([\'"]?)(?![a-z]+:|\/+)/i', 'url(\1'. $directory, $file);
+  return preg_replace('/url\(\s*([\'"]?)(?![a-z]+:|\/+)([^\'")]+)([\'"]?)\s*\)/i', 'url(\1' . $directory . '\2\3)', $file);
 }
 
 /**
@@ -5255,8 +5291,6 @@ function drupal_cron_run() {
     foreach ($queues as $queue_name => $info) {
       DrupalQueue::get($queue_name)->createQueue();
     }
-    // Register shutdown callback.
-    drupal_register_shutdown_function('drupal_cron_cleanup');
 
     // Iterate through the modules calling their cron handlers (if any):
     foreach (module_implements('cron') as $module) {
@@ -5308,10 +5342,13 @@ function drupal_cron_run() {
 }
 
 /**
- * Shutdown function: Performs cron cleanup.
+ * DEPRECATED: Shutdown function: Performs cron cleanup.
  *
- * @see drupal_cron_run()
- * @see drupal_register_shutdown_function()
+ * This function is deprecated because the 'cron_semaphore' variable it
+ * references no longer exists. It is therefore no longer used as a shutdown
+ * function by Drupal core.
+ *
+ * @deprecated
  */
 function drupal_cron_cleanup() {
   // See if the semaphore is still locked.
@@ -6636,10 +6673,10 @@ function drupal_array_set_nested_value(array &$array, array $parents, $value, $f
  * $value = drupal_array_get_nested_value($form, $parents);
  * @endcode
  *
- * The return value will be NULL, regardless of whether the actual value is NULL
- * or whether the requested key does not exist. If it is required to know
- * whether the nested array key actually exists, pass a third argument that is
- * altered by reference:
+ * A return value of NULL is ambiguous, and can mean either that the requested
+ * key does not exist, or that the actual value is NULL. If it is required to
+ * know whether the nested array key actually exists, pass a third argument that
+ * is altered by reference:
  * @code
  * $key_exists = NULL;
  * $value = drupal_array_get_nested_value($form, $parents, $key_exists);
@@ -7898,6 +7935,56 @@ function entity_prepare_view($entity_type, $entities, $langcode = NULL) {
   }
 }
 
+/**
+ * Invoke hook_entity_view_mode_alter().
+ *
+ * If adding a new entity similar to nodes, comments or users, you should invoke
+ * this function during the ENTITY_build_content() or ENTITY_view_multiple()
+ * phases of rendering to allow other modules to alter the view mode during this
+ * phase. This function needs to be called before field_attach_prepare_view() to
+ * ensure that the correct content is loaded by field API.
+ *
+ * @param $entity_type
+ *   The type of entity, i.e. 'node', 'user'.
+ * @param $entities
+ *   The entity objects which are being prepared for view, keyed by object ID.
+ * @param $view_mode
+ *   The original view mode e.g. 'full', 'teaser'...
+ * @param $langcode
+ *   (optional) A language code to be used for rendering. Defaults to the global
+ *   content language of the current request.
+ * @return
+ *   An associative array with arrays of entities keyed by view mode.
+ *
+ * @see hook_entity_view_mode_alter()
+ */
+function entity_view_mode_prepare($entity_type, $entities, $view_mode, $langcode = NULL) {
+  if (!isset($langcode)) {
+    $langcode = $GLOBALS['language_content']->language;
+  }
+
+  // To ensure hooks are never run after field_attach_prepare_view() only
+  // process items without the entity_view_prepared flag.
+  $entities_by_view_mode = array();
+  foreach ($entities as $id => $entity) {
+    $entity_view_mode = $view_mode;
+    if (empty($entity->entity_view_prepared)) {
+
+      // Allow modules to change the view mode.
+      $context = array(
+        'entity_type' => $entity_type,
+        'entity' => $entity,
+        'langcode' => $langcode,
+      );
+      drupal_alter('entity_view_mode', $entity_view_mode, $context);
+    }
+
+    $entities_by_view_mode[$entity_view_mode][$id] = $entity;
+  }
+
+  return $entities_by_view_mode;
+}
+
 /**
  * Returns the URI elements of an entity.
  *
diff --git a/drupal7/includes/database/mysql/schema.inc b/drupal7/includes/database/mysql/schema.inc
index 949cf4e8..2a2722e6 100644
--- a/drupal7/includes/database/mysql/schema.inc
+++ b/drupal7/includes/database/mysql/schema.inc
@@ -40,7 +40,7 @@ class DatabaseSchema_mysql extends DatabaseSchema {
     }
     else {
       $db_info = Database::getConnectionInfo();
-      $info['database'] = $db_info['default']['database'];
+      $info['database'] = $db_info[$this->connection->getTarget()]['database'];
       $info['table'] = $table;
     }
     return $info;
@@ -301,10 +301,10 @@ class DatabaseSchema_mysql extends DatabaseSchema {
 
   public function renameTable($table, $new_name) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename %table to %table_new: table %table doesn't exist.", array('%table' => $table, '%table_new' => $new_name)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", array('@table' => $table, '@table_new' => $new_name)));
     }
     if ($this->tableExists($new_name)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot rename %table to %table_new: table %table_new already exists.", array('%table' => $table, '%table_new' => $new_name)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot rename @table to @table_new: table @table_new already exists.", array('@table' => $table, '@table_new' => $new_name)));
     }
 
     $info = $this->getPrefixInfo($new_name);
@@ -322,10 +322,10 @@ class DatabaseSchema_mysql extends DatabaseSchema {
 
   public function addField($table, $field, $spec, $keys_new = array()) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field %table.%field: table doesn't exist.", array('%field' => $field, '%table' => $table)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", array('@field' => $field, '@table' => $table)));
     }
     if ($this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add field %table.%field: field already exists.", array('%field' => $field, '%table' => $table)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add field @table.@field: field already exists.", array('@field' => $field, '@table' => $table)));
     }
 
     $fixnull = FALSE;
@@ -361,7 +361,7 @@ class DatabaseSchema_mysql extends DatabaseSchema {
 
   public function fieldSetDefault($table, $field, $default) {
     if (!$this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
     }
 
     if (!isset($default)) {
@@ -376,7 +376,7 @@ class DatabaseSchema_mysql extends DatabaseSchema {
 
   public function fieldSetNoDefault($table, $field) {
     if (!$this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
     }
 
     $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN `' . $field . '` DROP DEFAULT');
@@ -391,10 +391,10 @@ class DatabaseSchema_mysql extends DatabaseSchema {
 
   public function addPrimaryKey($table, $fields) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table %table: table doesn't exist.", array('%table' => $table)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", array('@table' => $table)));
     }
     if ($this->indexExists($table, 'PRIMARY')) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table %table: primary key already exists.", array('%table' => $table)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table @table: primary key already exists.", array('@table' => $table)));
     }
 
     $this->connection->query('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . $this->createKeySql($fields) . ')');
@@ -411,10 +411,10 @@ class DatabaseSchema_mysql extends DatabaseSchema {
 
   public function addUniqueKey($table, $name, $fields) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
     }
     if ($this->indexExists($table, $name)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key %name to table %table: unique key already exists.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key @name to table @table: unique key already exists.", array('@table' => $table, '@name' => $name)));
     }
 
     $this->connection->query('ALTER TABLE {' . $table . '} ADD UNIQUE KEY `' . $name . '` (' . $this->createKeySql($fields) . ')');
@@ -431,10 +431,10 @@ class DatabaseSchema_mysql extends DatabaseSchema {
 
   public function addIndex($table, $name, $fields) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
     }
     if ($this->indexExists($table, $name)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add index %name to table %table: index already exists.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add index @name to table @table: index already exists.", array('@table' => $table, '@name' => $name)));
     }
 
     $this->connection->query('ALTER TABLE {' . $table . '} ADD INDEX `' . $name . '` (' . $this->createKeySql($fields) . ')');
@@ -451,10 +451,10 @@ class DatabaseSchema_mysql extends DatabaseSchema {
 
   public function changeField($table, $field, $field_new, $spec, $keys_new = array()) {
     if (!$this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field %table.%name: field doesn't exist.", array('%table' => $table, '%name' => $field)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", array('@table' => $table, '@name' => $field)));
     }
     if (($field != $field_new) && $this->fieldExists($table, $field_new)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field %table.%name to %name_new: target field already exists.", array('%table' => $table, '%name' => $field, '%name_new' => $field_new)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field @table.@name to @name_new: target field already exists.", array('@table' => $table, '@name' => $field, '@name_new' => $field_new)));
     }
 
     $sql = 'ALTER TABLE {' . $table . '} CHANGE `' . $field . '` ' . $this->createFieldSql($field_new, $this->processField($spec));
diff --git a/drupal7/includes/database/pgsql/schema.inc b/drupal7/includes/database/pgsql/schema.inc
index 49adbf90..f5774de1 100644
--- a/drupal7/includes/database/pgsql/schema.inc
+++ b/drupal7/includes/database/pgsql/schema.inc
@@ -314,10 +314,10 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
 
   function renameTable($table, $new_name) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename %table to %table_new: table %table doesn't exist.", array('%table' => $table, '%table_new' => $new_name)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", array('@table' => $table, '@table_new' => $new_name)));
     }
     if ($this->tableExists($new_name)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot rename %table to %table_new: table %table_new already exists.", array('%table' => $table, '%table_new' => $new_name)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot rename @table to @table_new: table @table_new already exists.", array('@table' => $table, '@table_new' => $new_name)));
     }
 
     // Get the schema and tablename for the old table.
@@ -351,10 +351,10 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
 
   public function addField($table, $field, $spec, $new_keys = array()) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field %table.%field: table doesn't exist.", array('%field' => $field, '%table' => $table)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", array('@field' => $field, '@table' => $table)));
     }
     if ($this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add field %table.%field: field already exists.", array('%field' => $field, '%table' => $table)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add field @table.@field: field already exists.", array('@field' => $field, '@table' => $table)));
     }
 
     $fixnull = FALSE;
@@ -393,7 +393,7 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
 
   public function fieldSetDefault($table, $field, $default) {
     if (!$this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
     }
 
     if (!isset($default)) {
@@ -408,7 +408,7 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
 
   public function fieldSetNoDefault($table, $field) {
     if (!$this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
     }
 
     $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" DROP DEFAULT');
@@ -435,10 +435,10 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
 
   public function addPrimaryKey($table, $fields) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table %table: table doesn't exist.", array('%table' => $table)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", array('@table' => $table)));
     }
     if ($this->constraintExists($table, 'pkey')) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table %table: primary key already exists.", array('%table' => $table)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table @table: primary key already exists.", array('@table' => $table)));
     }
 
     $this->connection->query('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . implode(',', $fields) . ')');
@@ -455,10 +455,10 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
 
   function addUniqueKey($table, $name, $fields) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
     }
     if ($this->constraintExists($table, $name . '_key')) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key %name to table %table: unique key already exists.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key @name to table @table: unique key already exists.", array('@table' => $table, '@name' => $name)));
     }
 
     $this->connection->query('ALTER TABLE {' . $table . '} ADD CONSTRAINT "' . $this->prefixNonTable($table, $name, 'key') . '" UNIQUE (' . implode(',', $fields) . ')');
@@ -475,10 +475,10 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
 
   public function addIndex($table, $name, $fields) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
     }
     if ($this->indexExists($table, $name)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add index %name to table %table: index already exists.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add index @name to table @table: index already exists.", array('@table' => $table, '@name' => $name)));
     }
 
     $this->connection->query($this->_createIndexSql($table, $name, $fields));
@@ -495,10 +495,10 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
 
   public function changeField($table, $field, $field_new, $spec, $new_keys = array()) {
     if (!$this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field %table.%name: field doesn't exist.", array('%table' => $table, '%name' => $field)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", array('@table' => $table, '@name' => $field)));
     }
     if (($field != $field_new) && $this->fieldExists($table, $field_new)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field %table.%name to %name_new: target field already exists.", array('%table' => $table, '%name' => $field, '%name_new' => $field_new)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field @table.@name to @name_new: target field already exists.", array('@table' => $table, '@name' => $field, '@name_new' => $field_new)));
     }
 
     $spec = $this->processField($spec);
diff --git a/drupal7/includes/database/schema.inc b/drupal7/includes/database/schema.inc
index 68843a49..1fc92954 100644
--- a/drupal7/includes/database/schema.inc
+++ b/drupal7/includes/database/schema.inc
@@ -654,7 +654,7 @@ abstract class DatabaseSchema implements QueryPlaceholderInterface {
    */
   public function createTable($name, $table) {
     if ($this->tableExists($name)) {
-      throw new DatabaseSchemaObjectExistsException(t('Table %name already exists.', array('%name' => $name)));
+      throw new DatabaseSchemaObjectExistsException(t('Table @name already exists.', array('@name' => $name)));
     }
     $statements = $this->createTableSql($name, $table);
     foreach ($statements as $statement) {
diff --git a/drupal7/includes/database/select.inc b/drupal7/includes/database/select.inc
index 70c03a28..3abd205c 100644
--- a/drupal7/includes/database/select.inc
+++ b/drupal7/includes/database/select.inc
@@ -377,7 +377,8 @@ interface SelectQueryInterface extends QueryConditionInterface, QueryAlterableIn
    * @param $field
    *   The field on which to order.
    * @param $direction
-   *   The direction to sort. Legal values are "ASC" and "DESC".
+   *   The direction to sort. Legal values are "ASC" and "DESC". Any other value
+   *   will be converted to "ASC".
    * @return SelectQueryInterface
    *   The called object.
    */
@@ -1384,6 +1385,8 @@ class SelectQuery extends Query implements SelectQueryInterface {
   }
 
   public function orderBy($field, $direction = 'ASC') {
+    // Only allow ASC and DESC, default to ASC.
+    $direction = strtoupper($direction) == 'DESC' ? 'DESC' : 'ASC';
     $this->order[$field] = $direction;
     return $this;
   }
diff --git a/drupal7/includes/database/sqlite/schema.inc b/drupal7/includes/database/sqlite/schema.inc
index c5882f12..df19d2fa 100644
--- a/drupal7/includes/database/sqlite/schema.inc
+++ b/drupal7/includes/database/sqlite/schema.inc
@@ -232,10 +232,10 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
 
   public function renameTable($table, $new_name) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename %table to %table_new: table %table doesn't exist.", array('%table' => $table, '%table_new' => $new_name)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", array('@table' => $table, '@table_new' => $new_name)));
     }
     if ($this->tableExists($new_name)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot rename %table to %table_new: table %table_new already exists.", array('%table' => $table, '%table_new' => $new_name)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot rename @table to @table_new: table @table_new already exists.", array('@table' => $table, '@table_new' => $new_name)));
     }
 
     $schema = $this->introspectSchema($table);
@@ -278,10 +278,10 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
 
   public function addField($table, $field, $specification, $keys_new = array()) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field %table.%field: table doesn't exist.", array('%field' => $field, '%table' => $table)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", array('@field' => $field, '@table' => $table)));
     }
     if ($this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add field %table.%field: field already exists.", array('%field' => $field, '%table' => $table)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add field @table.@field: field already exists.", array('@field' => $field, '@table' => $table)));
     }
 
     // SQLite doesn't have a full-featured ALTER TABLE statement. It only
@@ -494,10 +494,10 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
 
   public function changeField($table, $field, $field_new, $spec, $keys_new = array()) {
     if (!$this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field %table.%name: field doesn't exist.", array('%table' => $table, '%name' => $field)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", array('@table' => $table, '@name' => $field)));
     }
     if (($field != $field_new) && $this->fieldExists($table, $field_new)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field %table.%name to %name_new: target field already exists.", array('%table' => $table, '%name' => $field, '%name_new' => $field_new)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot rename field @table.@name to @name_new: target field already exists.", array('@table' => $table, '@name' => $field, '@name_new' => $field_new)));
     }
 
     $old_schema = $this->introspectSchema($table);
@@ -559,10 +559,10 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
 
   public function addIndex($table, $name, $fields) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
     }
     if ($this->indexExists($table, $name)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add index %name to table %table: index already exists.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add index @name to table @table: index already exists.", array('@table' => $table, '@name' => $name)));
     }
 
     $schema['indexes'][$name] = $fields;
@@ -591,10 +591,10 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
 
   public function addUniqueKey($table, $name, $fields) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key %name to table %table: table doesn't exist.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
     }
     if ($this->indexExists($table, $name)) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key %name to table %table: unique key already exists.", array('%table' => $table, '%name' => $name)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key @name to table @table: unique key already exists.", array('@table' => $table, '@name' => $name)));
     }
 
     $schema['unique keys'][$name] = $fields;
@@ -617,14 +617,14 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
 
   public function addPrimaryKey($table, $fields) {
     if (!$this->tableExists($table)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table %table: table doesn't exist.", array('%table' => $table)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", array('@table' => $table)));
     }
 
     $old_schema = $this->introspectSchema($table);
     $new_schema = $old_schema;
 
     if (!empty($new_schema['primary key'])) {
-      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table %table: primary key already exists.", array('%table' => $table)));
+      throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table @table: primary key already exists.", array('@table' => $table)));
     }
 
     $new_schema['primary key'] = $fields;
@@ -646,7 +646,7 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
 
   public function fieldSetDefault($table, $field, $default) {
     if (!$this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
     }
 
     $old_schema = $this->introspectSchema($table);
@@ -658,7 +658,7 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
 
   public function fieldSetNoDefault($table, $field) {
     if (!$this->fieldExists($table, $field)) {
-      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
+      throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
     }
 
     $old_schema = $this->introspectSchema($table);
diff --git a/drupal7/includes/file.inc b/drupal7/includes/file.inc
index d3008cc4..803661f4 100644
--- a/drupal7/includes/file.inc
+++ b/drupal7/includes/file.inc
@@ -1152,7 +1152,7 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) {
     // Remove any null bytes. See http://php.net/manual/security.filesystem.nullbytes.php
     $filename = str_replace(chr(0), '', $filename);
 
-    $whitelist = array_unique(explode(' ', trim($extensions)));
+    $whitelist = array_unique(explode(' ', strtolower(trim($extensions))));
 
     // Split the filename up by periods. The first part becomes the basename
     // the last part the final extension.
@@ -1165,7 +1165,7 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) {
     // of allowed extensions.
     foreach ($filename_parts as $filename_part) {
       $new_filename .= '.' . $filename_part;
-      if (!in_array($filename_part, $whitelist) && preg_match("/^[a-zA-Z]{2,5}\d?$/", $filename_part)) {
+      if (!in_array(strtolower($filename_part), $whitelist) && preg_match("/^[a-zA-Z]{2,5}\d?$/", $filename_part)) {
         $new_filename .= '_';
       }
     }
@@ -1729,8 +1729,6 @@ function file_validate_extensions(stdClass $file, $extensions) {
 /**
  * Checks that the file's size is below certain limits.
  *
- * This check is not enforced for the user #1.
- *
  * @param $file
  *   A Drupal file object.
  * @param $file_limit
@@ -1748,20 +1746,17 @@ function file_validate_extensions(stdClass $file, $extensions) {
  */
 function file_validate_size(stdClass $file, $file_limit = 0, $user_limit = 0) {
   global $user;
-
   $errors = array();
 
-  // Bypass validation for uid  = 1.
-  if ($user->uid != 1) {
-    if ($file_limit && $file->filesize > $file_limit) {
-      $errors[] = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size($file->filesize), '%maxsize' => format_size($file_limit)));
-    }
+  if ($file_limit && $file->filesize > $file_limit) {
+    $errors[] = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size($file->filesize), '%maxsize' => format_size($file_limit)));
+  }
 
-    // Save a query by only calling file_space_used() when a limit is provided.
-    if ($user_limit && (file_space_used($user->uid) + $file->filesize) > $user_limit) {
-      $errors[] = t('The file is %filesize which would exceed your disk quota of %quota.', array('%filesize' => format_size($file->filesize), '%quota' => format_size($user_limit)));
-    }
+  // Save a query by only calling file_space_used() when a limit is provided.
+  if ($user_limit && (file_space_used($user->uid) + $file->filesize) > $user_limit) {
+    $errors[] = t('The file is %filesize which would exceed your disk quota of %quota.', array('%filesize' => format_size($file->filesize), '%quota' => format_size($user_limit)));
   }
+
   return $errors;
 }
 
diff --git a/drupal7/includes/file.mimetypes.inc b/drupal7/includes/file.mimetypes.inc
index 7468a60a..5a161587 100644
--- a/drupal7/includes/file.mimetypes.inc
+++ b/drupal7/includes/file.mimetypes.inc
@@ -43,6 +43,7 @@ function file_default_mimetype_mapping() {
       4 => 'application/cap',
       5 => 'application/cu-seeme',
       6 => 'application/dsptype',
+      350 => 'application/epub+zip',
       7 => 'application/hta',
       8 => 'application/java-archive',
       9 => 'application/java-serialized-object',
@@ -64,6 +65,7 @@ function file_default_mimetype_mapping() {
       25 => 'application/rss+xml',
       26 => 'application/rtf',
       27 => 'application/smil',
+      349 => 'application/vnd.amazon.ebook',
       28 => 'application/vnd.cinderella',
       29 => 'application/vnd.google-earth.kml+xml',
       30 => 'application/vnd.google-earth.kmz',
@@ -183,6 +185,8 @@ function file_default_mimetype_mapping() {
       144 => 'application/x-lzx',
       145 => 'application/x-maker',
       146 => 'application/x-mif',
+      351 => 'application/x-mobipocket-ebook',
+      352 => 'application/x-mobipocket-ebook',
       147 => 'application/x-ms-wmd',
       148 => 'application/x-ms-wmz',
       149 => 'application/x-msdos-program',
@@ -228,8 +232,10 @@ function file_default_mimetype_mapping() {
       188 => 'audio/mpeg',
       189 => 'audio/ogg',
       190 => 'audio/prs.sid',
+      356 => 'audio/webm',
       191 => 'audio/x-aiff',
       192 => 'audio/x-gsm',
+      354 => 'audio/x-matroska',
       193 => 'audio/x-mpegurl',
       194 => 'audio/x-ms-wax',
       195 => 'audio/x-ms-wma',
@@ -301,6 +307,7 @@ function file_default_mimetype_mapping() {
       261 => 'image/vnd.djvu',
       262 => 'image/vnd.microsoft.icon',
       263 => 'image/vnd.wap.wbmp',
+      355 => 'image/webp',
       264 => 'image/x-cmu-raster',
       265 => 'image/x-coreldraw',
       266 => 'image/x-coreldrawpattern',
@@ -337,6 +344,7 @@ function file_default_mimetype_mapping() {
       297 => 'text/vnd.sun.j2me.app-descriptor',
       298 => 'text/vnd.wap.wml',
       299 => 'text/vnd.wap.wmlscript',
+      358 => 'text/vtt',
       300 => 'text/x-bibtex',
       301 => 'text/x-boo',
       302 => 'text/x-c++hdr',
@@ -371,9 +379,11 @@ function file_default_mimetype_mapping() {
       331 => 'video/ogg',
       332 => 'video/quicktime',
       333 => 'video/vnd.mpegurl',
+      357 => 'video/webm',
       347 => 'video/x-flv',
       334 => 'video/x-la-asf',
       348 => 'video/x-m4v',
+      353 => 'video/x-matroska',
       335 => 'video/x-mng',
       336 => 'video/x-ms-asf',
       337 => 'video/x-ms-wm',
@@ -854,6 +864,16 @@ function file_default_mimetype_mapping() {
       'f4b' => 346,
       'flv' => 347,
       'm4v' => 348,
+      'azw' => 349,
+      'epub' => 350,
+      'mobi' => 351,
+      'prc' => 352,
+      'mkv' => 353,
+      'mka' => 354,
+      'webp' => 355,
+      'weba' => 356,
+      'webm' => 357,
+      'vtt' => 358,
     ),
   );
 }
diff --git a/drupal7/includes/filetransfer/ssh.inc b/drupal7/includes/filetransfer/ssh.inc
index 43ec3249..dd7243e9 100644
--- a/drupal7/includes/filetransfer/ssh.inc
+++ b/drupal7/includes/filetransfer/ssh.inc
@@ -72,7 +72,8 @@ class FileTransferSSH extends FileTransfer implements FileTransferChmodInterface
         return TRUE;
       }
       return FALSE;
-    } else {
+    }
+    else {
       throw new FileTransferException('Cannot check @path.', NULL, array('@path' => $path));
     }
   }
@@ -85,7 +86,8 @@ class FileTransferSSH extends FileTransfer implements FileTransferChmodInterface
         return TRUE;
       }
       return FALSE;
-    } else {
+    }
+    else {
       throw new FileTransferException('Cannot check @path.', NULL, array('@path' => $path));
     }
   }
diff --git a/drupal7/includes/form.inc b/drupal7/includes/form.inc
index 3840885c..da1caa81 100644
--- a/drupal7/includes/form.inc
+++ b/drupal7/includes/form.inc
@@ -2699,17 +2699,43 @@ function theme_select($variables) {
 }
 
 /**
- * Converts a select form element's options array into HTML.
- *
- * @param $element
- *   An associative array containing the properties of the element.
- * @param $choices
- *   Mixed: Either an associative array of items to list as choices, or an
- *   object with an 'option' member that is an associative array. This
- *   parameter is only used internally and should not be passed.
- *
- * @return
- *   An HTML string of options for the select form element.
+ * Converts an array of options into HTML, for use in select list form elements.
+ *
+ * This function calls itself recursively to obtain the values for each optgroup
+ * within the list of options and when the function encounters an object with
+ * an 'options' property inside $element['#options'].
+ *
+ * @param array $element
+ *   An associative array containing the following key-value pairs:
+ *   - #multiple: Optional Boolean indicating if the user may select more than
+ *     one item.
+ *   - #options: An associative array of options to render as HTML. Each array
+ *     value can be a string, an array, or an object with an 'option' property:
+ *     - A string or integer key whose value is a translated string is
+ *       interpreted as a single HTML option element. Do not use placeholders
+ *       that sanitize data: doing so will lead to double-escaping. Note that
+ *       the key will be visible in the HTML and could be modified by malicious
+ *       users, so don't put sensitive information in it.
+ *     - A translated string key whose value is an array indicates a group of
+ *       options. The translated string is used as the label attribute for the
+ *       optgroup. Do not use placeholders to sanitize data: doing so will lead
+ *       to double-escaping. The array should contain the options you wish to
+ *       group and should follow the syntax of $element['#options'].
+ *     - If the function encounters a string or integer key whose value is an
+ *       object with an 'option' property, the key is ignored, the contents of
+ *       the option property are interpreted as $element['#options'], and the
+ *       resulting HTML is added to the output.
+ *   - #value: Optional integer, string, or array representing which option(s)
+ *     to pre-select when the list is first displayed. The integer or string
+ *     must match the key of an option in the '#options' list. If '#multiple' is
+ *     TRUE, this can be an array of integers or strings.
+ * @param array|null $choices
+ *   (optional) Either an associative array of options in the same format as
+ *   $element['#options'] above, or NULL. This parameter is only used internally
+ *   and is not intended to be passed in to the initial function call.
+ *
+ * @return string
+ *   An HTML string of options and optgroups for use in a select form element.
  */
 function form_select_options($element, $choices = NULL) {
   if (!isset($choices)) {
@@ -3285,6 +3311,8 @@ function form_process_container($element, &$form_state) {
  */
 function theme_container($variables) {
   $element = $variables['element'];
+  // Ensure #attributes is set.
+  $element += array('#attributes' => array());
 
   // Special handling for form elements.
   if (isset($element['#array_parents'])) {
diff --git a/drupal7/includes/install.inc b/drupal7/includes/install.inc
index 71de3e6c..f13ee8ac 100644
--- a/drupal7/includes/install.inc
+++ b/drupal7/includes/install.inc
@@ -420,7 +420,7 @@ abstract class DatabaseTasks {
       }
     }
     if (!empty($message)) {
-      $message = '<p>In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the <a href="http://drupal.org/getting-started/install">installation handbook</a>. If you are unsure what any of this means you should probably contact your hosting provider.</p>' . $message;
+      $message = 'Resolve all issues below to continue the installation. For help configuring your database server, see the <a href="http://drupal.org/getting-started/install">installation handbook</a>, or contact your hosting provider.' . $message;
       throw new DatabaseTaskException($message);
     }
   }
diff --git a/drupal7/includes/locale.inc b/drupal7/includes/locale.inc
index c168da0a..00ac1880 100644
--- a/drupal7/includes/locale.inc
+++ b/drupal7/includes/locale.inc
@@ -398,7 +398,7 @@ function locale_language_switcher_session($type, $path) {
       $links[$langcode]['query'][$param] = $langcode;
     }
     else {
-      $links[$langcode]['attributes']['class'][] = ' session-active';
+      $links[$langcode]['attributes']['class'][] = 'session-active';
     }
   }
 
diff --git a/drupal7/includes/lock.inc b/drupal7/includes/lock.inc
index 7dd8db30..db845618 100644
--- a/drupal7/includes/lock.inc
+++ b/drupal7/includes/lock.inc
@@ -92,7 +92,7 @@ function _lock_id() {
  * Acquire (or renew) a lock, but do not block if it fails.
  *
  * @param $name
- *   The name of the lock.
+ *   The name of the lock. Limit of name's length is 255 characters.
  * @param $timeout
  *   A number of seconds (float) before the lock expires (minimum of 0.001).
  *
diff --git a/drupal7/includes/mail.inc b/drupal7/includes/mail.inc
index 7a1d29ed..0275922b 100644
--- a/drupal7/includes/mail.inc
+++ b/drupal7/includes/mail.inc
@@ -10,7 +10,7 @@
  *
  * $conf['mail_line_endings'] will override this setting.
  */
-define('MAIL_LINE_ENDINGS', isset($_SERVER['WINDIR']) || strpos($_SERVER['SERVER_SOFTWARE'], 'Win32') !== FALSE ? "\r\n" : "\n");
+define('MAIL_LINE_ENDINGS', isset($_SERVER['WINDIR']) || (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Win32') !== FALSE) ? "\r\n" : "\n");
 
 /**
  * Composes and optionally sends an e-mail message.
diff --git a/drupal7/includes/menu.inc b/drupal7/includes/menu.inc
index fa5a71e7..2bfa39f6 100644
--- a/drupal7/includes/menu.inc
+++ b/drupal7/includes/menu.inc
@@ -2495,6 +2495,7 @@ function menu_link_get_preferred($path = NULL, $selected_menu = NULL) {
     $query->addField('ml', 'weight', 'link_weight');
     $query->fields('m');
     $query->condition('ml.link_path', $path_candidates, 'IN');
+    $query->addTag('preferred_menu_links');
 
     // Sort candidates by link path and menu name.
     $candidates = array();
diff --git a/drupal7/includes/tablesort.inc b/drupal7/includes/tablesort.inc
index e589526c..e9c28068 100644
--- a/drupal7/includes/tablesort.inc
+++ b/drupal7/includes/tablesort.inc
@@ -46,10 +46,9 @@ class TableSort extends SelectQueryExtender {
       // Based on code from db_escape_table(), but this can also contain a dot.
       $field = preg_replace('/[^A-Za-z0-9_.]+/', '', $ts['sql']);
 
-      // Sort order can only be ASC or DESC.
-      $sort = drupal_strtoupper($ts['sort']);
-      $sort = in_array($sort, array('ASC', 'DESC')) ? $sort : '';
-      $this->orderBy($field, $sort);
+      // orderBy() will ensure that only ASC/DESC values are accepted, so we
+      // don't need to sanitize that here.
+      $this->orderBy($field, $ts['sort']);
     }
     return $this;
   }
diff --git a/drupal7/includes/theme.inc b/drupal7/includes/theme.inc
index ee73965d..ed34b828 100644
--- a/drupal7/includes/theme.inc
+++ b/drupal7/includes/theme.inc
@@ -1029,6 +1029,7 @@ function theme($hook, $variables = array()) {
     }
     $hook = $candidate;
   }
+  $theme_hook_original = $hook;
 
   // If there's no implementation, check for more generic fallbacks. If there's
   // still no implementation, log an error and return an empty string.
@@ -1090,6 +1091,8 @@ function theme($hook, $variables = array()) {
     $variables += array($info['render element'] => array());
   }
 
+  $variables['theme_hook_original'] = $theme_hook_original;
+
   // Invoke the variable processors, if any. The processors may specify
   // alternate suggestions for which hook's template/function to use. If the
   // hook is a suggestion of a base hook, invoke the variable processors of
@@ -1198,7 +1201,12 @@ function theme($hook, $variables = array()) {
     if (isset($info['path'])) {
       $template_file = $info['path'] . '/' . $template_file;
     }
-    $output = $render_function($template_file, $variables);
+    if (variable_get('theme_debug', FALSE)) {
+      $output = _theme_render_template_debug($render_function, $template_file, $variables, $extension);
+    }
+    else {
+      $output = $render_function($template_file, $variables);
+    }
   }
 
   // restore path_to_theme()
@@ -1520,6 +1528,72 @@ function theme_render_template($template_file, $variables) {
   return ob_get_clean();
 }
 
+/**
+ * Renders a template for any engine.
+ *
+ * Includes the possibility to get debug output by setting the
+ * theme_debug variable to TRUE.
+ *
+ * @param string $template_function
+ *   The function to call for rendering the template.
+ * @param string $template_file
+ *   The filename of the template to render.
+ * @param array $variables
+ *   A keyed array of variables that will appear in the output.
+ * @param string $extension
+ *   The extension used by the theme engine for template files.
+ *
+ * @return string
+ *   The output generated by the template including debug information.
+ */
+function _theme_render_template_debug($template_function, $template_file, $variables, $extension) {
+  $output = array(
+    'debug_prefix' => '',
+    'debug_info' => '',
+    'rendered_markup' => call_user_func($template_function, $template_file, $variables),
+    'debug_suffix' => '',
+  );
+  $output['debug_prefix'] .= "\n\n<!-- THEME DEBUG -->";
+  $output['debug_prefix'] .= "\n<!-- CALL: theme('" . check_plain($variables['theme_hook_original']) . "') -->";
+  // If there are theme suggestions, reverse the array so more specific
+  // suggestions are shown first.
+  if (!empty($variables['theme_hook_suggestions'])) {
+    $variables['theme_hook_suggestions'] = array_reverse($variables['theme_hook_suggestions']);
+  }
+  // Add debug output for directly called suggestions like
+  // '#theme' => 'comment__node__article'.
+  if (strpos($variables['theme_hook_original'], '__') !== FALSE) {
+    $derived_suggestions[] = $hook = $variables['theme_hook_original'];
+    while ($pos = strrpos($hook, '__')) {
+      $hook = substr($hook, 0, $pos);
+      $derived_suggestions[] = $hook;
+    }
+    // Get the value of the base hook (last derived suggestion) and append it
+    // to the end of all theme suggestions.
+    $base_hook = array_pop($derived_suggestions);
+    $variables['theme_hook_suggestions'] = array_merge($derived_suggestions, $variables['theme_hook_suggestions']);
+    $variables['theme_hook_suggestions'][] = $base_hook;
+  }
+  if (!empty($variables['theme_hook_suggestions'])) {
+    $current_template = basename($template_file);
+    $suggestions = $variables['theme_hook_suggestions'];
+    // Only add the original theme hook if it wasn't a directly called
+    // suggestion.
+    if (strpos($variables['theme_hook_original'], '__') === FALSE) {
+      $suggestions[] = $variables['theme_hook_original'];
+    }
+    foreach ($suggestions as &$suggestion) {
+      $template = strtr($suggestion, '_', '-') . $extension;
+      $prefix = ($template == $current_template) ? 'x' : '*';
+      $suggestion = $prefix . ' ' . $template;
+    }
+    $output['debug_info'] .= "\n<!-- FILE NAME SUGGESTIONS:\n   " . check_plain(implode("\n   ", $suggestions)) . "\n-->";
+  }
+  $output['debug_info'] .= "\n<!-- BEGIN OUTPUT from '" . check_plain($template_file) . "' -->\n";
+  $output['debug_suffix'] .= "\n<!-- END OUTPUT from '" . check_plain($template_file) . "' -->\n\n";
+  return implode('', $output);
+}
+
 /**
  * Enables a given list of themes.
  *
@@ -1690,8 +1764,6 @@ function theme_links($variables) {
   $output = '';
 
   if (count($links) > 0) {
-    $output = '';
-
     // Treat the heading first if it is present to prepend it to the
     // list of links.
     if (!empty($heading)) {
diff --git a/drupal7/includes/unicode.inc b/drupal7/includes/unicode.inc
index fd497cca..f9684a89 100644
--- a/drupal7/includes/unicode.inc
+++ b/drupal7/includes/unicode.inc
@@ -116,11 +116,15 @@ function _unicode_check() {
   if (ini_get('mbstring.encoding_translation') != 0) {
     return array(UNICODE_ERROR, $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.encoding_translation</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
   }
-  if (ini_get('mbstring.http_input') != 'pass') {
-    return array(UNICODE_ERROR, $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_input</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
-  }
-  if (ini_get('mbstring.http_output') != 'pass') {
-    return array(UNICODE_ERROR, $t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_output</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
+  // mbstring.http_input and mbstring.http_output are deprecated and empty by
+  // default in PHP 5.6.
+  if (version_compare(PHP_VERSION, '5.6.0') == -1) {
+    if (ini_get('mbstring.http_input') != 'pass') {
+      return array(UNICODE_ERROR, $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_input</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
+    }
+    if (ini_get('mbstring.http_output') != 'pass') {
+      return array(UNICODE_ERROR, $t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_output</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
+    }
   }
 
   // Set appropriate configuration
diff --git a/drupal7/misc/ajax.js b/drupal7/misc/ajax.js
index 3b9dec61..01b894d7 100644
--- a/drupal7/misc/ajax.js
+++ b/drupal7/misc/ajax.js
@@ -618,6 +618,26 @@ Drupal.ajax.prototype.commands = {
       .filter(':odd').addClass('even');
   },
 
+  /**
+   * Command to add css.
+   *
+   * Uses the proprietary addImport method if available as browsers which
+   * support that method ignore @import statements in dynamically added
+   * stylesheets.
+   */
+  add_css: function (ajax, response, status) {
+    // Add the styles in the normal way.
+    $('head').prepend(response.data);
+    // Add imports in the styles using the addImport method if available.
+    var match, importMatch = /^@import url\("(.*)"\);$/igm;
+    if (document.styleSheets[0].addImport && importMatch.test(response.data)) {
+      importMatch.lastIndex = 0;
+      while (match = importMatch.exec(response.data)) {
+        document.styleSheets[0].addImport(match[1]);
+      }
+    }
+  },
+
   /**
    * Command to update a form's build ID.
    */
diff --git a/drupal7/misc/throbber-active.gif b/drupal7/misc/throbber-active.gif
new file mode 100644
index 00000000..f88bfdeb
Binary files /dev/null and b/drupal7/misc/throbber-active.gif differ
diff --git a/drupal7/misc/throbber-inactive.png b/drupal7/misc/throbber-inactive.png
new file mode 100644
index 00000000..f9146671
Binary files /dev/null and b/drupal7/misc/throbber-inactive.png differ
diff --git a/drupal7/modules/aggregator/aggregator.fetcher.inc b/drupal7/modules/aggregator/aggregator.fetcher.inc
index 0f728779..ed77bb61 100644
--- a/drupal7/modules/aggregator/aggregator.fetcher.inc
+++ b/drupal7/modules/aggregator/aggregator.fetcher.inc
@@ -27,7 +27,7 @@ function aggregator_aggregator_fetch($feed) {
     $headers['If-None-Match'] = $feed->etag;
   }
   if ($feed->modified) {
-    $headers['If-Modified-Since'] = gmdate(DATE_RFC1123, $feed->modified);
+    $headers['If-Modified-Since'] = gmdate(DATE_RFC7231, $feed->modified);
   }
 
   // Request feed.
diff --git a/drupal7/modules/aggregator/aggregator.info b/drupal7/modules/aggregator/aggregator.info
index 88c59869..7918abae 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/aggregator/tests/aggregator_test.info b/drupal7/modules/aggregator/tests/aggregator_test.info
index 70d884b8..f1f21b0a 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/aggregator/tests/aggregator_test.module b/drupal7/modules/aggregator/tests/aggregator_test.module
index 2d26a5d9..58d9818d 100644
--- a/drupal7/modules/aggregator/tests/aggregator_test.module
+++ b/drupal7/modules/aggregator/tests/aggregator_test.module
@@ -32,7 +32,7 @@ function aggregator_test_feed($use_last_modified = FALSE, $use_etag = FALSE) {
   // Send appropriate response. We respond with a 304 not modified on either
   // etag or on last modified.
   if ($use_last_modified) {
-    drupal_add_http_header('Last-Modified', gmdate(DATE_RFC1123, $last_modified));
+    drupal_add_http_header('Last-Modified', gmdate(DATE_RFC7231, $last_modified));
   }
   if ($use_etag) {
     drupal_add_http_header('ETag', $etag);
diff --git a/drupal7/modules/block/block.admin.inc b/drupal7/modules/block/block.admin.inc
index bd617906..f0e999de 100644
--- a/drupal7/modules/block/block.admin.inc
+++ b/drupal7/modules/block/block.admin.inc
@@ -272,7 +272,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
   $form['settings']['title'] = array(
     '#type' => 'textfield',
     '#title' => t('Block title'),
-    '#maxlength' => 64,
+    '#maxlength' => 255,
     '#description' => $block->module == 'block' ? t('The title of the block as shown to the user.') : t('Override the default title for the block. Use <em>!placeholder</em> to display no title, or leave blank to use the default block title.', array('!placeholder' => '&lt;none&gt;')),
     '#default_value' => isset($block->title) ? $block->title : '',
     '#weight' => -19,
diff --git a/drupal7/modules/block/block.info b/drupal7/modules/block/block.info
index b8d90153..f7b7f761 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/block/block.install b/drupal7/modules/block/block.install
index a78c885e..d8eab185 100644
--- a/drupal7/modules/block/block.install
+++ b/drupal7/modules/block/block.install
@@ -79,7 +79,7 @@ function block_schema() {
       ),
       'title' => array(
         'type' => 'varchar',
-        'length' => 64,
+        'length' => 255,
         'not null' => TRUE,
         'default' => '',
         'description' => 'Custom title for the block. (Empty string will use block default title, <none> will remove the title, text will cause block to use specified title.)',
@@ -472,6 +472,22 @@ function block_update_7008() {
   db_drop_field('block', 'throttle');
 }
 
+/**
+ * Increase {block}.title length to 255 characters.
+ */
+function block_update_7009() {
+  db_change_field('block', 'title', 'title',
+    array(
+      'type' => 'varchar',
+      'length' => 255,
+      'not null' => TRUE,
+      'default' => '',
+      'description' => 'Custom title for the block. (Empty string will use block default title, <none> will remove the title, text will cause block to use specified title.)',
+      'translatable' => TRUE,
+    )
+  );
+}
+
 /**
  * @} End of "addtogroup updates-7.x-extra".
  */
diff --git a/drupal7/modules/block/block.module b/drupal7/modules/block/block.module
index 2977ca88..b6a73326 100644
--- a/drupal7/modules/block/block.module
+++ b/drupal7/modules/block/block.module
@@ -848,10 +848,19 @@ function block_block_list_alter(&$blocks) {
  *   An array of visible blocks as expected by drupal_render().
  */
 function _block_render_blocks($region_blocks) {
-  // Block caching is not compatible with node access modules. We also
-  // preserve the submission of forms in blocks, by fetching from cache only
+  $cacheable = TRUE;
+
+  // We preserve the submission of forms in blocks, by fetching from cache only
   // if the request method is 'GET' (or 'HEAD').
-  $cacheable = !count(module_implements('node_grants')) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD');
+  if ($_SERVER['REQUEST_METHOD'] != 'GET' && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
+    $cacheable = FALSE;
+  }
+  // Block caching is not usually compatible with node access modules, so by
+  // default it is disabled when node access modules exist. However, it can be
+  // allowed by using the variable 'block_cache_bypass_node_grants'.
+  elseif (!variable_get('block_cache_bypass_node_grants', FALSE) && count(module_implements('node_grants'))) {
+    $cacheable = FALSE;
+  }
 
   // Proceed to loop over all blocks in order to compute their respective cache
   // identifiers; this allows us to do one single cache_get_multiple() call
@@ -1054,7 +1063,7 @@ function block_menu_delete($menu) {
  * Implements hook_form_FORM_ID_alter().
  */
 function block_form_system_performance_settings_alter(&$form, &$form_state) {
-  $disabled = count(module_implements('node_grants'));
+  $disabled = (!variable_get('block_cache_bypass_node_grants', FALSE) && count(module_implements('node_grants')));
   $form['caching']['block_cache'] = array(
     '#type' => 'checkbox',
     '#title' => t('Cache blocks'),
diff --git a/drupal7/modules/block/tests/block_test.info b/drupal7/modules/block/tests/block_test.info
index c97ad372..daa71ba2 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 4cb39e61..a70daae9 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/blog/blog.info b/drupal7/modules/blog/blog.info
index e4adf0a1..f33c9237 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/book/book.info b/drupal7/modules/book/book.info
index 6a63e329..e4b73875 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/color/color.info b/drupal7/modules/color/color.info
index f535bc71..b7e3e161 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/comment/comment.info b/drupal7/modules/comment/comment.info
index 2cd77774..50fb17ef 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/comment/comment.module b/drupal7/modules/comment/comment.module
index 3c942002..2972474c 100644
--- a/drupal7/modules/comment/comment.module
+++ b/drupal7/modules/comment/comment.module
@@ -993,12 +993,7 @@ function comment_build_content($comment, $node, $view_mode = 'full', $langcode =
   $comment->content = array();
 
   // Allow modules to change the view mode.
-  $context = array(
-    'entity_type' => 'comment',
-    'entity' => $comment,
-    'langcode' => $langcode,
-  );
-  drupal_alter('entity_view_mode', $view_mode, $context);
+  $view_mode = key(entity_view_mode_prepare('comment', array($comment->cid => $comment), $view_mode, $langcode));
 
   // Build fields content.
   field_attach_prepare_view('comment', array($comment->cid => $comment), $view_mode, $langcode);
@@ -1108,17 +1103,26 @@ function comment_links($comment, $node) {
  *   An array in the format expected by drupal_render().
  */
 function comment_view_multiple($comments, $node, $view_mode = 'full', $weight = 0, $langcode = NULL) {
-  field_attach_prepare_view('comment', $comments, $view_mode, $langcode);
-  entity_prepare_view('comment', $comments, $langcode);
+  $build = array();
+  $entities_by_view_mode = entity_view_mode_prepare('comment', $comments, $view_mode, $langcode);
+  foreach ($entities_by_view_mode as $entity_view_mode => $entities) {
+    field_attach_prepare_view('comment', $entities, $entity_view_mode, $langcode);
+    entity_prepare_view('comment', $entities, $langcode);
+
+    foreach ($entities as $entity) {
+      $build[$entity->cid] = comment_view($entity, $node, $entity_view_mode, $langcode);
+    }
+  }
 
-  $build = array(
-    '#sorted' => TRUE,
-  );
   foreach ($comments as $comment) {
-    $build[$comment->cid] = comment_view($comment, $node, $view_mode, $langcode);
     $build[$comment->cid]['#weight'] = $weight;
     $weight++;
   }
+  // Sort here, to preserve the input order of the entities that were passed to
+  // this function.
+  uasort($build, 'element_sort');
+  $build['#sorted'] = TRUE;
+
   return $build;
 }
 
diff --git a/drupal7/modules/contact/contact.info b/drupal7/modules/contact/contact.info
index 20902d2b..d2e9c654 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/contextual/contextual.info b/drupal7/modules/contextual/contextual.info
index 6376de6f..8c83dba9 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/dashboard/dashboard.info b/drupal7/modules/dashboard/dashboard.info
index 549526b7..acea9d2c 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/dashboard/dashboard.js b/drupal7/modules/dashboard/dashboard.js
index 62f13a41..6a55e6cf 100644
--- a/drupal7/modules/dashboard/dashboard.js
+++ b/drupal7/modules/dashboard/dashboard.js
@@ -32,13 +32,13 @@ Drupal.behaviors.dashboard = {
           empty_text = Drupal.settings.dashboard.emptyRegionTextInactive;
         }
         // We need a placeholder.
-        if ($('.placeholder', this).length == 0) {
-          $(this).append('<div class="placeholder"></div>');
+        if ($('.dashboard-placeholder', this).length == 0) {
+          $(this).append('<div class="dashboard-placeholder"></div>');
         }
-        $('.placeholder', this).html(empty_text);
+        $('.dashboard-placeholder', this).html(empty_text);
       }
       else {
-        $('.placeholder', this).remove();
+        $('.dashboard-placeholder', this).remove();
       }
     });
   },
diff --git a/drupal7/modules/dblog/dblog.info b/drupal7/modules/dblog/dblog.info
index d17d67f7..37559a8c 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/field/field.api.php b/drupal7/modules/field/field.api.php
index 365fc404..e8361c22 100644
--- a/drupal7/modules/field/field.api.php
+++ b/drupal7/modules/field/field.api.php
@@ -1328,10 +1328,27 @@ function hook_field_attach_load($entity_type, $entities, $age, $options) {
  * @param $entity
  *   The entity with fields to validate.
  * @param array $errors
- *   An associative array of errors keyed by field_name, language, delta.
+ *   The array of errors (keyed by field name, language code, and delta) that
+ *   have already been reported for the entity. The function should add its
+ *   errors to this array. Each error is an associative array with the following
+ *   keys and values:
+ *   - error: An error code (should be a string prefixed with the module name).
+ *   - message: The human readable message to be displayed.
  */
 function hook_field_attach_validate($entity_type, $entity, &$errors) {
-  // @todo Needs function body.
+  // Make sure any images in article nodes have an alt text.
+  if ($entity_type == 'node' && $entity->type == 'article' && !empty($entity->field_image)) {
+    foreach ($entity->field_image as $langcode => $items) {
+      foreach ($items as $delta => $item) {
+        if (!empty($item['fid']) && empty($item['alt'])) {
+          $errors['field_image'][$langcode][$delta][] = array(
+            'error' => 'field_example_invalid',
+            'message' => t('All images in articles need to have an alternative text set.'),
+          );
+        }
+      }
+    }
+  }
 }
 
 /**
diff --git a/drupal7/modules/field/field.attach.inc b/drupal7/modules/field/field.attach.inc
index 4a90961d..897f9521 100644
--- a/drupal7/modules/field/field.attach.inc
+++ b/drupal7/modules/field/field.attach.inc
@@ -318,7 +318,7 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b =
         // Unless a language suggestion is provided we iterate on all the
         // available languages.
         $available_languages = field_available_languages($entity_type, $field);
-        $language = !empty($options['language'][$id]) ? $options['language'][$id] : $options['language'];
+        $language = is_array($options['language']) && !empty($options['language'][$id]) ? $options['language'][$id] : $options['language'];
         $languages = _field_language_suggestion($available_languages, $language, $field_name);
         foreach ($languages as $langcode) {
           $grouped_items[$field_id][$langcode][$id] = isset($entity->{$field_name}[$langcode]) ? $entity->{$field_name}[$langcode] : array();
diff --git a/drupal7/modules/field/field.crud.inc b/drupal7/modules/field/field.crud.inc
index e4486d03..ba377083 100644
--- a/drupal7/modules/field/field.crud.inc
+++ b/drupal7/modules/field/field.crud.inc
@@ -60,11 +60,11 @@ function field_create_field($field) {
   }
   // Field type is required.
   if (empty($field['type'])) {
-    throw new FieldException('Attempt to create a field with no type.');
+    throw new FieldException(format_string('Attempt to create field @field_name with no type.', array('@field_name' => $field['field_name'])));
   }
   // Field name cannot contain invalid characters.
   if (!preg_match('/^[_a-z]+[_a-z0-9]*$/', $field['field_name'])) {
-    throw new FieldException('Attempt to create a field with invalid characters. Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character');
+    throw new FieldException(format_string('Attempt to create a field @field_name with invalid characters. Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character', array('@field_name' => $field['field_name'])));
   }
 
   // Field name cannot be longer than 32 characters. We use drupal_strlen()
diff --git a/drupal7/modules/field/field.info b/drupal7/modules/field/field.info
index fed2d684..c68c333a 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/field/field.info.class.inc b/drupal7/modules/field/field.info.class.inc
index 3b89898f..f4f1f630 100644
--- a/drupal7/modules/field/field.info.class.inc
+++ b/drupal7/modules/field/field.info.class.inc
@@ -146,7 +146,10 @@ class FieldInfo {
 
     // Save in "static" and persistent caches.
     $this->fieldMap = $map;
-    cache_set('field_info:field_map', $map, 'cache_field');
+    if (lock_acquire('field_info:field_map')) {
+      cache_set('field_info:field_map', $map, 'cache_field');
+      lock_release('field_info:field_map');
+    }
 
     return $map;
   }
@@ -174,7 +177,10 @@ class FieldInfo {
       }
 
       // Store in persistent cache.
-      cache_set('field_info:fields', $this->fieldsById, 'cache_field');
+      if (lock_acquire('field_info:fields')) {
+        cache_set('field_info:fields', $this->fieldsById, 'cache_field');
+        lock_release('field_info:fields');
+      }
     }
 
     // Fill the name/ID map.
@@ -231,7 +237,10 @@ class FieldInfo {
         }
 
         // Store in persistent cache.
-        cache_set('field_info:instances', $this->bundleInstances, 'cache_field');
+        if (lock_acquire('field_info:instances')) {
+          cache_set('field_info:instances', $this->bundleInstances, 'cache_field');
+          lock_release('field_info:instances');
+        }
       }
 
       $this->loadedAllInstances = TRUE;
@@ -419,7 +428,11 @@ class FieldInfo {
     foreach ($instances as $instance) {
       $cache['fields'][] = $this->fieldsById[$instance['field_id']];
     }
-    cache_set("field_info:bundle:$entity_type:$bundle", $cache, 'cache_field');
+
+    if (lock_acquire("field_info:bundle:$entity_type:$bundle")) {
+      cache_set("field_info:bundle:$entity_type:$bundle", $cache, 'cache_field');
+      lock_release("field_info:bundle:$entity_type:$bundle");
+    }
 
     return $instances;
   }
@@ -460,7 +473,10 @@ class FieldInfo {
 
     // Store in the 'static' and persistent caches.
     $this->bundleExtraFields[$entity_type][$bundle] = $info;
-    cache_set("field_info:bundle_extra:$entity_type:$bundle", $info, 'cache_field');
+    if (lock_acquire("field_info:bundle_extra:$entity_type:$bundle")) {
+      cache_set("field_info:bundle_extra:$entity_type:$bundle", $info, 'cache_field');
+      lock_release("field_info:bundle_extra:$entity_type:$bundle");
+    }
 
     return $this->bundleExtraFields[$entity_type][$bundle];
   }
diff --git a/drupal7/modules/field/field.info.inc b/drupal7/modules/field/field.info.inc
index 02b3c9ca..dea2fd4f 100644
--- a/drupal7/modules/field/field.info.inc
+++ b/drupal7/modules/field/field.info.inc
@@ -223,7 +223,11 @@ function _field_info_collate_types($reset = FALSE) {
       }
       drupal_alter('field_storage_info', $info['storage types']);
 
-      cache_set("field_info_types:$langcode", $info, 'cache_field');
+      // Set the cache if we can acquire a lock.
+      if (lock_acquire("field_info_types:$langcode")) {
+        cache_set("field_info_types:$langcode", $info, 'cache_field');
+        lock_release("field_info_types:$langcode");
+      }
     }
   }
 
diff --git a/drupal7/modules/field/field.install b/drupal7/modules/field/field.install
index c5c5005d..f6948e3b 100644
--- a/drupal7/modules/field/field.install
+++ b/drupal7/modules/field/field.install
@@ -162,6 +162,7 @@ function field_schema() {
     ),
   );
   $schema['cache_field'] = drupal_get_schema_unprocessed('system', 'cache');
+  $schema['cache_field']['description'] = 'Cache table for the Field module to store already built field information.';
 
   return $schema;
 }
diff --git a/drupal7/modules/field/field.module b/drupal7/modules/field/field.module
index 132238ec..a593e511 100644
--- a/drupal7/modules/field/field.module
+++ b/drupal7/modules/field/field.module
@@ -342,17 +342,6 @@ function field_cron() {
   field_purge_batch($limit);
 }
 
-/**
- * Implements hook_modules_uninstalled().
- */
-function field_modules_uninstalled($modules) {
-  module_load_include('inc', 'field', 'field.crud');
-  foreach ($modules as $module) {
-    // TODO D7: field_module_delete is not yet implemented
-    // field_module_delete($module);
-  }
-}
-
 /**
  * Implements hook_system_info_alter().
  *
@@ -947,14 +936,17 @@ function field_get_items($entity_type, $entity, $field_name, $langcode = NULL) {
  */
 function field_has_data($field) {
   $query = new EntityFieldQuery();
-  return (bool) $query
-    ->fieldCondition($field)
+  $query = $query->fieldCondition($field)
     ->range(0, 1)
     ->count()
     // Neutralize the 'entity_field_access' query tag added by
     // field_sql_storage_field_storage_query(). The result cannot depend on the
     // access grants of the current user.
-    ->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT')
+    ->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT');
+
+  return (bool) $query
+    ->execute() || (bool) $query
+    ->age(FIELD_LOAD_REVISION)
     ->execute();
 }
 
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 69d3b7d5..f43ed837 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 93f20771..7ab4ee5c 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
@@ -64,6 +64,49 @@ function _field_sql_storage_revision_tablename($field) {
   }
 }
 
+/**
+ * Generates a table alias for a field data table.
+ *
+ * The table alias is unique for each unique combination of field name
+ * (represented by $tablename), delta_group and language_group.
+ *
+ * @param $tablename
+ *   The name of the data table for this field.
+ * @param $field_key
+ *   The numeric key of this field in this query.
+ * @param $query
+ *   The EntityFieldQuery that is executed.
+ *
+ * @return
+ *   A string containing the generated table alias.
+ */
+function _field_sql_storage_tablealias($tablename, $field_key, EntityFieldQuery $query) {
+  // No conditions present: use a unique alias.
+  if (empty($query->fieldConditions[$field_key])) {
+    return $tablename . $field_key;
+  }
+
+  // Find the delta and language condition values and append them to the alias.
+  $condition = $query->fieldConditions[$field_key];
+  $alias = $tablename;
+  $has_group_conditions = FALSE;
+
+  foreach (array('delta', 'language') as $column) {
+    if (isset($condition[$column . '_group'])) {
+      $alias .= '_' . $column . '_' . $condition[$column . '_group'];
+      $has_group_conditions = TRUE;
+    }
+  }
+
+  // Return the alias when it has delta/language group conditions.
+  if ($has_group_conditions) {
+    return $alias;
+  }
+
+  // Return a unique alias in other cases.
+  return $tablename . $field_key;
+}
+
 /**
  * Generate a column name for a field data table.
  *
@@ -504,17 +547,21 @@ function field_sql_storage_field_storage_query(EntityFieldQuery $query) {
     $id_key = 'revision_id';
   }
   $table_aliases = array();
+  $query_tables = NULL;
   // Add tables for the fields used.
   foreach ($query->fields as $key => $field) {
     $tablename = $tablename_function($field);
-    // Every field needs a new table.
-    $table_alias = $tablename . $key;
+    $table_alias = _field_sql_storage_tablealias($tablename, $key, $query);
     $table_aliases[$key] = $table_alias;
     if ($key) {
-      $select_query->join($tablename, $table_alias, "$table_alias.entity_type = $field_base_table.entity_type AND $table_alias.$id_key = $field_base_table.$id_key");
+      if (!isset($query_tables[$table_alias])) {
+        $select_query->join($tablename, $table_alias, "$table_alias.entity_type = $field_base_table.entity_type AND $table_alias.$id_key = $field_base_table.$id_key");
+      }
     }
     else {
       $select_query = db_select($tablename, $table_alias);
+      // Store a reference to the list of joined tables.
+      $query_tables =& $select_query->getTables();
       // Allow queries internal to the Field API to opt out of the access
       // check, for situations where the query's results should not depend on
       // the access grants for the current user.
diff --git a/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.test b/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.test
index 12c54ba2..072739cb 100644
--- a/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.test
+++ b/drupal7/modules/field/modules/field_sql_storage/field_sql_storage.test
@@ -438,4 +438,149 @@ class FieldSqlStorageTestCase extends DrupalWebTestCase {
     $this->assertEqual($foreign_key['table'], $foreign_key_name, 'Foreign key table name preserved in the schema');
     $this->assertEqual($foreign_key['columns'][$foreign_key_column], 'id', 'Foreign key column name preserved in the schema');
   }
+
+  /**
+   * Test handling multiple conditions on one column of a field.
+   *
+   * Tests both the result and the complexity of the query.
+   */
+  function testFieldSqlStorageMultipleConditionsSameColumn() {
+    $entity = field_test_create_stub_entity(NULL, NULL);
+    $entity->{$this->field_name}[LANGUAGE_NONE][0] = array('value' => 1);
+    field_test_entity_save($entity);
+
+    $entity = field_test_create_stub_entity(NULL, NULL);
+    $entity->{$this->field_name}[LANGUAGE_NONE][0] = array('value' => 2);
+    field_test_entity_save($entity);
+
+    $entity = field_test_create_stub_entity(NULL, NULL);
+    $entity->{$this->field_name}[LANGUAGE_NONE][0] = array('value' => 3);
+    field_test_entity_save($entity);
+
+    $query = new EntityFieldQuery();
+    // This tag causes field_test_query_store_global_test_query_alter() to be
+    // invoked so that the query can be tested.
+    $query->addTag('store_global_test_query');
+    $query->entityCondition('entity_type', 'test_entity');
+    $query->entityCondition('bundle', 'test_bundle');
+    $query->fieldCondition($this->field_name, 'value', 1, '<>', 0, LANGUAGE_NONE);
+    $query->fieldCondition($this->field_name, 'value', 2, '<>', 0, LANGUAGE_NONE);
+    $result = field_sql_storage_field_storage_query($query);
+
+    // Test the results.
+    $this->assertEqual(1, count($result), format_string('One result should be returned, got @count', array('@count' => count($result))));
+
+    // Test the complexity of the query.
+    $query = $GLOBALS['test_query'];
+    $this->assertNotNull($query, 'Precondition: the query should be available');
+    $tables = $query->getTables();
+    $this->assertEqual(1, count($tables), 'The query contains just one table.');
+
+    // Clean up.
+    unset($GLOBALS['test_query']);
+  }
+
+  /**
+   * Test handling multiple conditions on multiple columns of one field.
+   *
+   * Tests both the result and the complexity of the query.
+   */
+  function testFieldSqlStorageMultipleConditionsDifferentColumns() {
+    // Create the multi-column shape field
+    $field_name = strtolower($this->randomName());
+    $field = array('field_name' => $field_name, 'type' => 'shape', 'cardinality' => 4);
+    $field = field_create_field($field);
+    $instance = array(
+      'field_name' => $field_name,
+      'entity_type' => 'test_entity',
+      'bundle' => 'test_bundle'
+    );
+    $instance = field_create_instance($instance);
+
+    $entity = field_test_create_stub_entity(NULL, NULL);
+    $entity->{$field_name}[LANGUAGE_NONE][0] = array('shape' => 'A', 'color' => 'X');
+    field_test_entity_save($entity);
+
+    $entity = field_test_create_stub_entity(NULL, NULL);
+    $entity->{$field_name}[LANGUAGE_NONE][0] = array('shape' => 'B', 'color' => 'X');
+    field_test_entity_save($entity);
+
+    $entity = field_test_create_stub_entity(NULL, NULL);
+    $entity->{$field_name}[LANGUAGE_NONE][0] = array('shape' => 'A', 'color' => 'Y');
+    field_test_entity_save($entity);
+
+    $query = new EntityFieldQuery();
+    // This tag causes field_test_query_store_global_test_query_alter() to be
+    // invoked so that the query can be tested.
+    $query->addTag('store_global_test_query');
+    $query->entityCondition('entity_type', 'test_entity');
+    $query->entityCondition('bundle', 'test_bundle');
+    $query->fieldCondition($field_name, 'shape', 'B', '=', 'something', LANGUAGE_NONE);
+    $query->fieldCondition($field_name, 'color', 'X', '=', 'something', LANGUAGE_NONE);
+    $result = field_sql_storage_field_storage_query($query);
+
+    // Test the results.
+    $this->assertEqual(1, count($result), format_string('One result should be returned, got @count', array('@count' => count($result))));
+
+    // Test the complexity of the query.
+    $query = $GLOBALS['test_query'];
+    $this->assertNotNull($query, 'Precondition: the query should be available');
+    $tables = $query->getTables();
+    $this->assertEqual(1, count($tables), 'The query contains just one table.');
+
+    // Clean up.
+    unset($GLOBALS['test_query']);
+  }
+
+  /**
+   * Test handling multiple conditions on multiple columns of one field for multiple languages.
+   *
+   * Tests both the result and the complexity of the query.
+   */
+  function testFieldSqlStorageMultipleConditionsDifferentColumnsMultipleLanguages() {
+    field_test_entity_info_translatable('test_entity', TRUE);
+
+    // Create the multi-column shape field
+    $field_name = strtolower($this->randomName());
+    $field = array('field_name' => $field_name, 'type' => 'shape', 'cardinality' => 4, 'translatable' => TRUE);
+    $field = field_create_field($field);
+    $instance = array(
+      'field_name' => $field_name,
+      'entity_type' => 'test_entity',
+      'bundle' => 'test_bundle',
+      'settings' => array(
+        // Prevent warning from field_test_field_load().
+        'test_hook_field_load' => FALSE,
+      ),
+    );
+    $instance = field_create_instance($instance);
+
+    $entity = field_test_create_stub_entity(NULL, NULL);
+    $entity->{$field_name}[LANGUAGE_NONE][0] = array('shape' => 'A', 'color' => 'X');
+    $entity->{$field_name}['en'][0] = array('shape' => 'B', 'color' => 'Y');
+    field_test_entity_save($entity);
+    $entity = field_test_entity_test_load($entity->ftid);
+
+    $query = new EntityFieldQuery();
+    // This tag causes field_test_query_store_global_test_query_alter() to be
+    // invoked so that the query can be tested.
+    $query->addTag('store_global_test_query');
+    $query->entityCondition('entity_type', 'test_entity');
+    $query->entityCondition('bundle', 'test_bundle');
+    $query->fieldCondition($field_name, 'color', 'X', '=', NULL, LANGUAGE_NONE);
+    $query->fieldCondition($field_name, 'shape', 'B', '=', NULL, 'en');
+    $result = field_sql_storage_field_storage_query($query);
+
+    // Test the results.
+    $this->assertEqual(1, count($result), format_string('One result should be returned, got @count', array('@count' => count($result))));
+
+    // Test the complexity of the query.
+    $query = $GLOBALS['test_query'];
+    $this->assertNotNull($query, 'Precondition: the query should be available');
+    $tables = $query->getTables();
+    $this->assertEqual(2, count($tables), 'The query contains two tables.');
+
+    // Clean up.
+    unset($GLOBALS['test_query']);
+  }
 }
diff --git a/drupal7/modules/field/modules/list/list.info b/drupal7/modules/field/modules/list/list.info
index d43f47d4..5d8001c1 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/field/modules/list/tests/list_test.info b/drupal7/modules/field/modules/list/tests/list_test.info
index cdaf9256..389b0a9b 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/field/modules/number/number.info b/drupal7/modules/field/modules/number/number.info
index 1fc96017..2b5f1fd5 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/field/modules/options/options.info b/drupal7/modules/field/modules/options/options.info
index ce8fc2e7..7ea78717 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/field/modules/text/text.info b/drupal7/modules/field/modules/text/text.info
index 1a674019..7c87786b 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/field/modules/text/text.js b/drupal7/modules/field/modules/text/text.js
index f3ae8943..e8e270ac 100644
--- a/drupal7/modules/field/modules/text/text.js
+++ b/drupal7/modules/field/modules/text/text.js
@@ -12,9 +12,9 @@ Drupal.behaviors.textSummary = {
 
       $summaries.once('text-summary-wrapper').each(function(index) {
         var $summary = $(this);
-        var $summaryLabel = $summary.find('label');
+        var $summaryLabel = $summary.find('label').first();
         var $full = $widget.find('.text-full').eq(index).closest('.form-item');
-        var $fullLabel = $full.find('label');
+        var $fullLabel = $full.find('label').first();
 
         // Create a placeholder label when the field cardinality is
         // unlimited or greater than 1.
@@ -23,24 +23,28 @@ Drupal.behaviors.textSummary = {
         }
 
         // Setup the edit/hide summary link.
-        var $link = $('<span class="field-edit-link">(<a class="link-edit-summary" href="#">' + Drupal.t('Hide summary') + '</a>)</span>').toggle(
-          function () {
+        var $link = $('<span class="field-edit-link">(<a class="link-edit-summary" href="#">' + Drupal.t('Hide summary') + '</a>)</span>');
+        var $a = $link.find('a');
+        var toggleClick = true;
+        $link.bind('click', function (e) {
+          if (toggleClick) {
             $summary.hide();
-            $(this).find('a').html(Drupal.t('Edit summary')).end().appendTo($fullLabel);
-            return false;
-          },
-          function () {
+            $a.html(Drupal.t('Edit summary'));
+            $link.appendTo($fullLabel);
+          }
+          else {
             $summary.show();
-            $(this).find('a').html(Drupal.t('Hide summary')).end().appendTo($summaryLabel);
-            return false;
+            $a.html(Drupal.t('Hide summary'));
+            $link.appendTo($summaryLabel);
           }
-        ).appendTo($summaryLabel);
+          toggleClick = !toggleClick;
+          return false;
+        }).appendTo($summaryLabel);
 
         // If no summary is set, hide the summary field.
         if ($(this).find('.text-summary').val() == '') {
           $link.click();
         }
-        return;
       });
     });
   }
diff --git a/drupal7/modules/field/modules/text/text.module b/drupal7/modules/field/modules/text/text.module
index d73814fa..68fc3cb4 100644
--- a/drupal7/modules/field/modules/text/text.module
+++ b/drupal7/modules/field/modules/text/text.module
@@ -245,7 +245,7 @@ function text_field_formatter_settings_summary($field, $instance, $view_mode) {
   $summary = '';
 
   if (strpos($display['type'], '_trimmed') !== FALSE) {
-    $summary = t('Trim length') . ': ' . $settings['trim_length'];
+    $summary = t('Trim length') . ': ' . check_plain($settings['trim_length']);
   }
 
   return $summary;
diff --git a/drupal7/modules/field/tests/field.test b/drupal7/modules/field/tests/field.test
index 1e593154..b279d6a8 100644
--- a/drupal7/modules/field/tests/field.test
+++ b/drupal7/modules/field/tests/field.test
@@ -484,6 +484,66 @@ class FieldAttachStorageTestCase extends FieldAttachTestCase {
     $this->assertEqual($entity->{$this->field_name}[$langcode], $values, 'Insert: missing field results in default value saved');
   }
 
+  /**
+   * Test field_has_data().
+   */
+  function testFieldHasData() {
+    $entity_type = 'test_entity';
+    $langcode = LANGUAGE_NONE;
+
+    $field_name = 'field_1';
+    $field = array('field_name' => $field_name, 'type' => 'test_field');
+    $field = field_create_field($field);
+
+    $this->assertFalse(field_has_data($field), "No data should be detected.");
+
+    $instance = array(
+      'field_name' => $field_name,
+      'entity_type' => 'test_entity',
+      'bundle' => 'test_bundle'
+    );
+    $instance = field_create_instance($instance);
+    $table = _field_sql_storage_tablename($field);
+    $revision_table = _field_sql_storage_revision_tablename($field);
+
+    $columns = array('entity_type', 'entity_id', 'revision_id', 'delta', 'language', $field_name . '_value');
+
+    $eid = 0;
+
+    // Insert values into the field revision table.
+    $query = db_insert($revision_table)->fields($columns);
+    $query->values(array($entity_type, $eid, 0, 0, $langcode, 1));
+    $query->execute();
+
+    $this->assertTrue(field_has_data($field), "Revision data only should be detected.");
+
+    $field_name = 'field_2';
+    $field = array('field_name' => $field_name, 'type' => 'test_field');
+    $field = field_create_field($field);
+
+    $this->assertFalse(field_has_data($field), "No data should be detected.");
+
+    $instance = array(
+      'field_name' => $field_name,
+      'entity_type' => 'test_entity',
+      'bundle' => 'test_bundle'
+    );
+    $instance = field_create_instance($instance);
+    $table = _field_sql_storage_tablename($field);
+    $revision_table = _field_sql_storage_revision_tablename($field);
+
+    $columns = array('entity_type', 'entity_id', 'revision_id', 'delta', 'language', $field_name . '_value');
+
+    $eid = 1;
+
+    // Insert values into the field table.
+    $query = db_insert($table)->fields($columns);
+    $query->values(array($entity_type, $eid, 0, 0, $langcode, 1));
+    $query->execute();
+
+    $this->assertTrue(field_has_data($field), "Values only in field table should be detected.");
+  }
+
   /**
    * Test field_attach_delete().
    */
diff --git a/drupal7/modules/field/tests/field_test.info b/drupal7/modules/field/tests/field_test.info
index 87359e20..017a3b2f 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/field/tests/field_test.module b/drupal7/modules/field/tests/field_test.module
index dc2023a7..9daa2c30 100644
--- a/drupal7/modules/field/tests/field_test.module
+++ b/drupal7/modules/field/tests/field_test.module
@@ -267,3 +267,14 @@ function field_test_query_efq_table_prefixing_test_alter(&$query) {
   // exception if the EFQ does not properly prefix the base table.
   $query->join('test_entity','te2','%alias.ftid = test_entity.ftid');
 }
+
+/**
+ * Implements hook_query_TAG_alter() for tag 'store_global_test_query'.
+ */
+function field_test_query_store_global_test_query_alter($query) {
+  // Save the query in a global variable so that it can be examined by tests.
+  // This can be used by any test which needs to check a query, but see
+  // FieldSqlStorageTestCase::testFieldSqlStorageMultipleConditionsSameColumn()
+  // for an example.
+  $GLOBALS['test_query'] = $query;
+}
diff --git a/drupal7/modules/field_ui/field_ui.info b/drupal7/modules/field_ui/field_ui.info
index 5b911758..52fb1e7a 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/file/file.field.inc b/drupal7/modules/file/file.field.inc
index 59b547a7..b26d7e45 100644
--- a/drupal7/modules/file/file.field.inc
+++ b/drupal7/modules/file/file.field.inc
@@ -92,6 +92,7 @@ function file_field_instance_settings_form($field, $instance) {
     '#description' => t('Separate extensions with a space or comma and do not include the leading dot.'),
     '#element_validate' => array('_file_generic_settings_extensions'),
     '#weight' => 1,
+    '#maxlength' => 256,
     // By making this field required, we prevent a potential security issue
     // that would allow files of any type to be uploaded.
     '#required' => TRUE,
diff --git a/drupal7/modules/file/file.info b/drupal7/modules/file/file.info
index 7a1ca562..cf190976 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/file/tests/file_module_test.info b/drupal7/modules/file/tests/file_module_test.info
index 1f401359..f19d8df2 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/filter/filter.info b/drupal7/modules/filter/filter.info
index 91fa3301..e867db27 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/filter/filter.pages.inc b/drupal7/modules/filter/filter.pages.inc
index 50f81177..e602bcef 100644
--- a/drupal7/modules/filter/filter.pages.inc
+++ b/drupal7/modules/filter/filter.pages.inc
@@ -68,7 +68,7 @@ function theme_filter_tips($variables) {
     foreach ($tips as $name => $tiplist) {
       if ($multiple) {
         $output .= '<div class="filter-type filter-' . drupal_html_class($name) . '">';
-        $output .= '<h3>' . $name . '</h3>';
+        $output .= '<h3>' . check_plain($name) . '</h3>';
       }
 
       if (count($tiplist) > 0) {
diff --git a/drupal7/modules/filter/filter.test b/drupal7/modules/filter/filter.test
index cc0295b5..fe9cfc36 100644
--- a/drupal7/modules/filter/filter.test
+++ b/drupal7/modules/filter/filter.test
@@ -70,6 +70,15 @@ class FilterCRUDTestCase extends DrupalWebTestCase {
     $this->assertFalse($db_format->status, 'Database: Disabled text format is marked as disabled.');
     $formats = filter_formats();
     $this->assertTrue(!isset($formats[$format->format]), 'filter_formats: Disabled text format no longer exists.');
+
+    // Add a new format to check for Xss in format name.
+    $format = new stdClass();
+    $format->format = 'xss_format';
+    $format->name = '<script>alert(123)</script>';
+    filter_format_save($format);
+    user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(filter_permission_name($format) => 1));
+    $this->drupalGet('filter/tips');
+    $this->assertNoRaw($format->name, 'Text format name contains no xss.');
   }
 
   /**
diff --git a/drupal7/modules/forum/forum.info b/drupal7/modules/forum/forum.info
index d23cc736..8924c8f5 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/forum/forum.module b/drupal7/modules/forum/forum.module
index 575de36a..1224418a 100644
--- a/drupal7/modules/forum/forum.module
+++ b/drupal7/modules/forum/forum.module
@@ -263,10 +263,10 @@ function _forum_node_check_node_type($node) {
  * Implements hook_node_view().
  */
 function forum_node_view($node, $view_mode) {
-  $vid = variable_get('forum_nav_vocabulary', 0);
-  $vocabulary = taxonomy_vocabulary_load($vid);
   if (_forum_node_check_node_type($node)) {
     if ($view_mode == 'full' && node_is_page($node)) {
+      $vid = variable_get('forum_nav_vocabulary', 0);
+      $vocabulary = taxonomy_vocabulary_load($vid);
       // Breadcrumb navigation
       $breadcrumb[] = l(t('Home'), NULL);
       $breadcrumb[] = l($vocabulary->name, 'forum');
diff --git a/drupal7/modules/help/help.info b/drupal7/modules/help/help.info
index ba19af7c..c0657c7f 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/image/image.info b/drupal7/modules/image/image.info
index 01168771..a67d02f8 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/image/image.module b/drupal7/modules/image/image.module
index c6a23f25..a2a0f416 100644
--- a/drupal7/modules/image/image.module
+++ b/drupal7/modules/image/image.module
@@ -845,6 +845,12 @@ function image_style_deliver($style, $scheme) {
     }
   }
 
+  // Confirm that the original source image exists before trying to process it.
+  if (!is_file($image_uri)) {
+    watchdog('image', 'Source image at %source_image_path not found while trying to generate derivative image at %derivative_path.',  array('%source_image_path' => $image_uri, '%derivative_path' => $derivative_uri));
+    return MENU_NOT_FOUND;
+  }
+
   // Don't start generating the image if the derivative already exists or if
   // generation is in progress in another thread.
   $lock_name = 'image_style_deliver:' . $style['name'] . ':' . drupal_hash_base64($image_uri);
@@ -854,6 +860,7 @@ function image_style_deliver($style, $scheme) {
       // Tell client to retry again in 3 seconds. Currently no browsers are known
       // to support Retry-After.
       drupal_add_http_header('Status', '503 Service Unavailable');
+      drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
       drupal_add_http_header('Retry-After', 3);
       print t('Image generation in progress. Try again shortly.');
       drupal_exit();
@@ -875,6 +882,7 @@ function image_style_deliver($style, $scheme) {
   else {
     watchdog('image', 'Unable to generate the derived image located at %path.', array('%path' => $derivative_uri));
     drupal_add_http_header('Status', '500 Internal Server Error');
+    drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
     print t('Error generating image.');
     drupal_exit();
   }
diff --git a/drupal7/modules/image/image.test b/drupal7/modules/image/image.test
index 4a4aab05..2387314c 100644
--- a/drupal7/modules/image/image.test
+++ b/drupal7/modules/image/image.test
@@ -173,6 +173,16 @@ class ImageStylesPathAndUrlTestCase extends DrupalWebTestCase {
     $this->_testImageStyleUrlAndPath('public', TRUE, TRUE);
   }
 
+  /**
+   * Test that an invalid source image returns a 404.
+   */
+  function testImageStyleUrlForMissingSourceImage() {
+    $non_existent_uri = 'public://foo.png';
+    $generated_url = image_style_url($this->style_name, $non_existent_uri);
+    $this->drupalGet($generated_url);
+    $this->assertResponse(404, 'Accessing an image style URL with a source image that does not exist provides a 404 error response.');
+  }
+
   /**
    * Test image_style_url().
    */
diff --git a/drupal7/modules/image/tests/image_module_test.info b/drupal7/modules/image/tests/image_module_test.info
index 6d419e11..40d67313 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/locale/locale.info b/drupal7/modules/locale/locale.info
index 3ca7bed0..8028869d 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/locale/tests/locale_test.info b/drupal7/modules/locale/tests/locale_test.info
index c86e9961..dc5d5a6f 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/menu/menu.info b/drupal7/modules/menu/menu.info
index 8fd0c12b..ee436db5 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/menu/menu.module b/drupal7/modules/menu/menu.module
index 64447912..dc8f015d 100644
--- a/drupal7/modules/menu/menu.module
+++ b/drupal7/modules/menu/menu.module
@@ -69,7 +69,7 @@ function menu_menu() {
     'title' => 'Parent menu items',
     'page callback' => 'menu_parent_options_js',
     'type' => MENU_CALLBACK,
-    'access arguments' => array(TRUE),
+    'access arguments' => array('administer menu'),
   );
   $items['admin/structure/menu/list'] = array(
     'title' => 'List menus',
diff --git a/drupal7/modules/menu/menu.test b/drupal7/modules/menu/menu.test
index 95e0ee9e..a9bdb5f2 100644
--- a/drupal7/modules/menu/menu.test
+++ b/drupal7/modules/menu/menu.test
@@ -513,6 +513,23 @@ class MenuTestCase extends DrupalWebTestCase {
     }
   }
 
+  /**
+   * Test administrative users other than user 1 can access the menu parents AJAX callback.
+   */
+  public function testMenuParentsJsAccess() {
+    $admin = $this->drupalCreateUser(array('administer menu'));
+    $this->drupalLogin($admin);
+    // Just check access to the callback overall, the POST data is irrelevant.
+    $this->drupalGetAJAX('admin/structure/menu/parents');
+    $this->assertResponse(200);
+
+    // Do standard user tests.
+    // Login the user.
+    $this->drupalLogin($this->std_user);
+    $this->drupalGetAJAX('admin/structure/menu/parents');
+    $this->assertResponse(403);
+  }
+
   /**
    * Get standard menu link.
    */
diff --git a/drupal7/modules/node/node.api.php b/drupal7/modules/node/node.api.php
index 95026761..a83dee94 100644
--- a/drupal7/modules/node/node.api.php
+++ b/drupal7/modules/node/node.api.php
@@ -17,11 +17,14 @@
  * During node operations (create, update, view, delete, etc.), there are
  * several sets of hooks that get invoked to allow modules to modify the base
  * node operation:
- * - Node-type-specific hooks: These hooks are only invoked on the primary
- *   module, using the "base" return component of hook_node_info() as the
- *   function prefix.  For example, poll.module defines the base for the Poll
- *   content type as "poll", so during creation of a poll node, hook_insert() is
- *   only invoked by calling poll_insert().
+ * - Node-type-specific hooks: When defining a node type, hook_node_info()
+ *   returns a 'base' component. Node-type-specific hooks are named
+ *   base_hookname() instead of mymodule_hookname() (in a module called
+ *   'mymodule' for example). Only the node type's corresponding implementation
+ *   is invoked. For example, poll_node_info() in poll.module defines the base
+ *   for the 'poll' node type as 'poll'. So when a poll node is created,
+ *   hook_insert() is invoked on poll_insert() only.
+ *   Hooks that are node-type-specific are noted below.
  * - All-module hooks: This set of hooks is invoked on all implementing modules,
  *   to allow other modules to modify what the primary node module is doing. For
  *   example, hook_node_insert() is invoked on all modules when creating a poll
@@ -195,7 +198,7 @@ function hook_node_grants($account, $op) {
   if (user_access('access private content', $account)) {
     $grants['example'] = array(1);
   }
-  $grants['example_owner'] = array($account->uid);
+  $grants['example_author'] = array($account->uid);
   return $grants;
 }
 
@@ -885,11 +888,10 @@ function hook_node_view_alter(&$build) {
  *   name as the key. Each sub-array has up to 10 attributes. Possible
  *   attributes:
  *   - name: (required) The human-readable name of the node type.
- *   - base: (required) The base string used to construct callbacks
- *     corresponding to this node type (for example, if base is defined as
- *     example_foo, then example_foo_insert will be called when inserting a node
- *     of that type). This string is usually the name of the module, but not
- *     always.
+ *   - base: (required) The base name for implementations of node-type-specific
+ *     hooks that respond to this node type. Base is usually the name of the
+ *     module or 'node_content', but not always. See
+ *     @link node_api_hooks Node API hooks @endlink for more information.
  *   - description: (required) A brief description of the node type.
  *   - help: (optional) Help information shown to the user when creating a node
  *     of this type.
@@ -1030,8 +1032,11 @@ function hook_node_type_delete($info) {
 /**
  * Respond to node deletion.
  *
- * This hook is invoked only on the module that defines the node's content type
- * (use hook_node_delete() to respond to all node deletions).
+ * This is a node-type-specific hook, which is invoked only for the node type
+ * being affected. See
+ * @link node_api_hooks Node API hooks @endlink for more information.
+ *
+ * Use hook_node_delete() to respond to node deletion of all node types.
  *
  * This hook is invoked from node_delete_multiple() before hook_node_delete()
  * is invoked and before field_attach_delete() is called.
@@ -1059,8 +1064,11 @@ function hook_delete($node) {
 /**
  * Act on a node object about to be shown on the add/edit form.
  *
- * This hook is invoked only on the module that defines the node's content type
- * (use hook_node_prepare() to act on all node preparations).
+ * This is a node-type-specific hook, which is invoked only for the node type
+ * being affected. See
+ * @link node_api_hooks Node API hooks @endlink for more information.
+ *
+ * Use hook_node_prepare() to respond to node preparation of all node types.
  *
  * This hook is invoked from node_object_prepare() before the general
  * hook_node_prepare() is invoked.
@@ -1089,6 +1097,13 @@ function hook_prepare($node) {
 /**
  * Display a node editing form.
  *
+ * This is a node-type-specific hook, which is invoked only for the node type
+ * being affected. See
+ * @link node_api_hooks Node API hooks @endlink for more information.
+ *
+ * Use hook_form_BASE_FORM_ID_alter(), with base form ID 'node_form', to alter
+ * node forms for all node types.
+ *
  * This hook, implemented by node modules, is called to retrieve the form
  * that is displayed to create or edit a node. This form is displayed at path
  * node/add/[node type] or node/[node ID]/edit.
@@ -1144,8 +1159,11 @@ function hook_form($node, &$form_state) {
 /**
  * Respond to creation of a new node.
  *
- * This hook is invoked only on the module that defines the node's content type
- * (use hook_node_insert() to act on all node insertions).
+ * This is a node-type-specific hook, which is invoked only for the node type
+ * being affected. See
+ * @link node_api_hooks Node API hooks @endlink for more information.
+ *
+ * Use hook_node_insert() to respond to node insertion of all node types.
  *
  * This hook is invoked from node_save() after the node is inserted into the
  * node table in the database, before field_attach_insert() is called, and
@@ -1168,8 +1186,11 @@ function hook_insert($node) {
 /**
  * Act on nodes being loaded from the database.
  *
- * This hook is invoked only on the module that defines the node's content type
- * (use hook_node_load() to respond to all node loads).
+ * This is a node-type-specific hook, which is invoked only for the node type
+ * being affected. See
+ * @link node_api_hooks Node API hooks @endlink for more information.
+ *
+ * Use hook_node_load() to respond to node load of all node types.
  *
  * This hook is invoked during node loading, which is handled by entity_load(),
  * via classes NodeController and DrupalDefaultEntityController. After the node
@@ -1202,8 +1223,11 @@ function hook_load($nodes) {
 /**
  * Respond to updates to a node.
  *
- * This hook is invoked only on the module that defines the node's content type
- * (use hook_node_update() to act on all node updates).
+ * This is a node-type-specific hook, which is invoked only for the node type
+ * being affected. See
+ * @link node_api_hooks Node API hooks @endlink for more information.
+ *
+ * Use hook_node_update() to respond to node update of all node types.
  *
  * This hook is invoked from node_save() after the node is updated in the
  * node table in the database, before field_attach_update() is called, and
@@ -1224,8 +1248,11 @@ function hook_update($node) {
 /**
  * Perform node validation before a node is created or updated.
  *
- * This hook is invoked only on the module that defines the node's content type
- * (use hook_node_validate() to act on all node validations).
+ * This is a node-type-specific hook, which is invoked only for the node type
+ * being affected. See
+ * @link node_api_hooks Node API hooks @endlink for more information.
+ *
+ * Use hook_node_validate() to respond to node validation of all node types.
  *
  * This hook is invoked from node_validate(), after a user has finished
  * editing the node and is previewing or submitting it. It is invoked at the end
@@ -1258,8 +1285,11 @@ function hook_validate($node, $form, &$form_state) {
 /**
  * Display a node.
  *
- * This hook is invoked only on the module that defines the node's content type
- * (use hook_node_view() to act on all node views).
+ * This is a node-type-specific hook, which is invoked only for the node type
+ * being affected. See
+ * @link node_api_hooks Node API hooks @endlink for more information.
+ *
+ * Use hook_node_view() to respond to node view of all node types.
  *
  * This hook is invoked during node viewing after the node is fully loaded, so
  * that the node type module can define a custom method for display, or add to
diff --git a/drupal7/modules/node/node.info b/drupal7/modules/node/node.info
index 831a47ff..8906557a 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/node/node.module b/drupal7/modules/node/node.module
index 5a4e0194..dbb1a650 100644
--- a/drupal7/modules/node/node.module
+++ b/drupal7/modules/node/node.module
@@ -210,7 +210,7 @@ function node_entity_info() {
         'custom settings' => FALSE,
       ),
       'search_result' => array(
-        'label' => t('Search result'),
+        'label' => t('Search result highlighting input'),
         'custom settings' => FALSE,
       ),
     );
@@ -1397,12 +1397,7 @@ function node_build_content($node, $view_mode = 'full', $langcode = NULL) {
   $node->content = array();
 
   // Allow modules to change the view mode.
-  $context = array(
-    'entity_type' => 'node',
-    'entity' => $node,
-    'langcode' => $langcode,
-  );
-  drupal_alter('entity_view_mode', $view_mode, $context);
+  $view_mode = key(entity_view_mode_prepare('node', array($node->nid => $node), $view_mode, $langcode));
 
   // The 'view' hook can be implemented to overwrite the default function
   // to display nodes.
@@ -2604,9 +2599,10 @@ function node_feed($nids = FALSE, $channel = array()) {
 
     $node->link = url("node/$node->nid", array('absolute' => TRUE));
     $node->rss_namespaces = array();
+    $account = user_load($node->uid);
     $node->rss_elements = array(
       array('key' => 'pubDate', 'value' => gmdate('r', $node->created)),
-      array('key' => 'dc:creator', 'value' => $node->name),
+      array('key' => 'dc:creator', 'value' => format_username($account)),
       array('key' => 'guid', 'value' => $node->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false'))
     );
 
@@ -2664,15 +2660,26 @@ function node_feed($nids = FALSE, $channel = array()) {
  *   An array in the format expected by drupal_render().
  */
 function node_view_multiple($nodes, $view_mode = 'teaser', $weight = 0, $langcode = NULL) {
-  field_attach_prepare_view('node', $nodes, $view_mode, $langcode);
-  entity_prepare_view('node', $nodes, $langcode);
   $build = array();
+  $entities_by_view_mode = entity_view_mode_prepare('node', $nodes, $view_mode, $langcode);
+  foreach ($entities_by_view_mode as $entity_view_mode => $entities) {
+    field_attach_prepare_view('node', $entities, $entity_view_mode, $langcode);
+    entity_prepare_view('node', $entities, $langcode);
+
+    foreach ($entities as $entity) {
+      $build['nodes'][$entity->nid] = node_view($entity, $entity_view_mode, $langcode);
+    }
+  }
+
   foreach ($nodes as $node) {
-    $build['nodes'][$node->nid] = node_view($node, $view_mode, $langcode);
     $build['nodes'][$node->nid]['#weight'] = $weight;
     $weight++;
   }
+  // Sort here, to preserve the input order of the entities that were passed to
+  // this function.
+  uasort($build['nodes'], 'element_sort');
   $build['nodes']['#sorted'] = TRUE;
+
   return $build;
 }
 
@@ -3629,7 +3636,8 @@ function node_access_rebuild($batch_mode = FALSE) {
       // Try to allocate enough time to rebuild node grants
       drupal_set_time_limit(240);
 
-      $nids = db_query("SELECT nid FROM {node}")->fetchCol();
+      // Rebuild newest nodes first so that recent content becomes available quickly.
+      $nids = db_query("SELECT nid FROM {node} ORDER BY nid DESC")->fetchCol();
       foreach ($nids as $nid) {
         $node = node_load($nid, NULL, TRUE);
         // To preserve database integrity, only acquire grants if the node
diff --git a/drupal7/modules/node/node.test b/drupal7/modules/node/node.test
index 0777e113..5c9118eb 100644
--- a/drupal7/modules/node/node.test
+++ b/drupal7/modules/node/node.test
@@ -2782,8 +2782,8 @@ class NodeEntityViewModeAlterTest extends NodeWebTestCase {
     $edit = array();
     $langcode = LANGUAGE_NONE;
     $edit["title"] = $this->randomName(8);
-    $edit["body[$langcode][0][value]"] = t('Data that should appear only in the body for the node.');
-    $edit["body[$langcode][0][summary]"] = t('Extra data that should appear only in the teaser for the node.');
+    $edit["body[$langcode][0][value]"] = 'Data that should appear only in the body for the node.';
+    $edit["body[$langcode][0][summary]"] = 'Extra data that should appear only in the teaser for the node.';
     $this->drupalPost('node/add/page', $edit, t('Save'));
 
     $node = $this->drupalGetNodeByTitle($edit["title"]);
@@ -2801,6 +2801,45 @@ class NodeEntityViewModeAlterTest extends NodeWebTestCase {
     $build = node_view($node);
     $this->assertEqual($build['#view_mode'], 'teaser', 'The view mode has correctly been set to teaser.');
   }
+
+  /**
+   * Tests fields that were previously hidden when the view mode is changed.
+   */
+  function testNodeViewModeChangeHiddenField() {
+    // Hide the tags field on the default display
+    $instance = field_info_instance('node', 'field_tags', 'article');
+    $instance['display']['default']['type'] = 'hidden';
+    field_update_instance($instance);
+
+    $web_user = $this->drupalCreateUser(array('create article content', 'edit own article content'));
+    $this->drupalLogin($web_user);
+
+    // Create a node.
+    $edit = array();
+    $langcode = LANGUAGE_NONE;
+    $edit["title"] = $this->randomName(8);
+    $edit["body[$langcode][0][value]"] = 'Data that should appear only in the body for the node.';
+    $edit["body[$langcode][0][summary]"] = 'Extra data that should appear only in the teaser for the node.';
+    $edit["field_tags[$langcode]"] = 'Extra tag';
+    $this->drupalPost('node/add/article', $edit, t('Save'));
+
+    $node = $this->drupalGetNodeByTitle($edit["title"]);
+
+    // Set the flag to alter the view mode and view the node.
+    variable_set('node_test_change_view_mode', 'teaser');
+    $this->drupalGet('node/' . $node->nid);
+
+    // Check that teaser mode is viewed.
+    $this->assertText('Extra data that should appear only in the teaser for the node.', 'Teaser text present');
+    // Make sure body text is not present.
+    $this->assertNoText('Data that should appear only in the body for the node.', 'Body text not present');
+    // Make sure tags are present.
+    $this->assertText('Extra tag', 'Taxonomy term present');
+
+    // Test that the correct build mode has been set.
+    $build = node_view($node);
+    $this->assertEqual($build['#view_mode'], 'teaser', 'The view mode has correctly been set to teaser.');
+  }
 }
 
 /**
diff --git a/drupal7/modules/node/tests/node_access_test.info b/drupal7/modules/node/tests/node_access_test.info
index e6100db3..29f7975e 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/node/tests/node_test.info b/drupal7/modules/node/tests/node_test.info
index 50d374b0..cd83e010 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/node/tests/node_test_exception.info b/drupal7/modules/node/tests/node_test_exception.info
index 3ddb410f..bb81ab00 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/openid/openid.info b/drupal7/modules/openid/openid.info
index 38a2c04c..c531b6c6 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/openid/tests/openid_test.info b/drupal7/modules/openid/tests/openid_test.info
index 8c948841..d67f3caf 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/overlay/overlay.info b/drupal7/modules/overlay/overlay.info
index d26406ac..fed2841a 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/path/path.info b/drupal7/modules/path/path.info
index 19da1cee..81cf5f51 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/php/php.info b/drupal7/modules/php/php.info
index a21a0e62..0340d2ec 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/poll/poll.info b/drupal7/modules/poll/poll.info
index 2092e040..0edb0136 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/poll/poll.module b/drupal7/modules/poll/poll.module
index 70eb65dc..d3d64b17 100644
--- a/drupal7/modules/poll/poll.module
+++ b/drupal7/modules/poll/poll.module
@@ -249,6 +249,7 @@ function poll_form($node, &$form_state) {
     '#title' => check_plain($type->title_label),
     '#required' => TRUE,
     '#default_value' => $node->title,
+    '#maxlength' => 255,
     '#weight' => -5,
   );
 
@@ -720,7 +721,6 @@ function poll_view_voting($form, &$form_state, $node, $block = FALSE) {
       '#type' => 'radios',
       '#title' => t('Choices'),
       '#title_display' => 'invisible',
-      '#default_value' => -1,
       '#options' => $list,
     );
   }
@@ -748,7 +748,7 @@ function poll_view_voting($form, &$form_state, $node, $block = FALSE) {
  * Validation function for processing votes
  */
 function poll_view_voting_validate($form, &$form_state) {
-  if ($form_state['values']['choice'] == -1) {
+  if (empty($form_state['values']['choice'])) {
     form_set_error( 'choice', t('Your vote could not be recorded because you did not select any of the choices.'));
   }
 }
@@ -925,7 +925,6 @@ function template_preprocess_poll_results(&$variables) {
  *
  * @see poll-bar.tpl.php
  * @see poll-bar--block.tpl.php
- * @see theme_poll_bar()
  */
 function template_preprocess_poll_bar(&$variables) {
   if ($variables['block']) {
diff --git a/drupal7/modules/poll/poll.test b/drupal7/modules/poll/poll.test
index 35eea223..e24032d5 100644
--- a/drupal7/modules/poll/poll.test
+++ b/drupal7/modules/poll/poll.test
@@ -315,6 +315,11 @@ class PollVoteTestCase extends PollTestCase {
 
     $this->drupalLogin($vote_user);
 
+    // Record a vote without selecting any choice.
+    $edit = array();
+    $this->drupalPost('node/' . $poll_nid, $edit, t('Vote'));
+    $this->assertText(t('Your vote could not be recorded because you did not select any of the choices.'), 'Found the empty poll submission error message.');
+
     // Record a vote for the first choice.
     $edit = array(
       'choice' => '1',
diff --git a/drupal7/modules/profile/profile.info b/drupal7/modules/profile/profile.info
index deab4fe5..76781418 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/rdf/rdf.info b/drupal7/modules/rdf/rdf.info
index cf3c9298..98d18762 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/rdf/rdf.module b/drupal7/modules/rdf/rdf.module
index 877b598c..90a73826 100644
--- a/drupal7/modules/rdf/rdf.module
+++ b/drupal7/modules/rdf/rdf.module
@@ -190,17 +190,33 @@ function _rdf_get_default_mapping($type) {
  *   An RDF mapping structure or an empty array if no record was found.
  */
 function _rdf_mapping_load($type, $bundle) {
-  $mapping = db_select('rdf_mapping')
-    ->fields(NULL, array('mapping'))
+  $mappings = _rdf_mapping_load_multiple($type, array($bundle));
+  return $mappings ? reset($mappings) : array();
+}
+
+/**
+ * Helper function to retrieve a set of RDF mappings from the database.
+ *
+ * @param $type
+ *   The entity type of the mappings.
+ * @param $bundles
+ *   The bundles the mappings refer to.
+ *
+ * @return
+ *   An array of RDF mapping structures, or an empty array.
+ */
+function _rdf_mapping_load_multiple($type, array $bundles) {
+  $mappings = db_select('rdf_mapping')
+    ->fields(NULL, array('bundle', 'mapping'))
     ->condition('type', $type)
-    ->condition('bundle', $bundle)
+    ->condition('bundle', $bundles)
     ->execute()
-    ->fetchField();
+    ->fetchAllKeyed();
 
-  if (!$mapping) {
-    return array();
+  foreach ($mappings as $bundle => $mapping) {
+    $mappings[$bundle] = unserialize($mapping);
   }
-  return unserialize($mapping);
+  return $mappings;
 }
 
 /**
@@ -368,10 +384,13 @@ function rdf_modules_uninstalled($modules) {
 function rdf_entity_info_alter(&$entity_info) {
   // Loop through each entity type and its bundles.
   foreach ($entity_info as $entity_type => $entity_type_info) {
-    if (isset($entity_type_info['bundles'])) {
-      foreach ($entity_type_info['bundles'] as $bundle => $bundle_info) {
-        if ($mapping = _rdf_mapping_load($entity_type, $bundle)) {
-          $entity_info[$entity_type]['bundles'][$bundle]['rdf_mapping'] = $mapping;
+    if (!empty($entity_type_info['bundles'])) {
+      $bundles = array_keys($entity_type_info['bundles']);
+      $mappings = _rdf_mapping_load_multiple($entity_type, $bundles);
+
+      foreach ($bundles as $bundle) {
+        if (isset($mappings[$bundle])) {
+          $entity_info[$entity_type]['bundles'][$bundle]['rdf_mapping'] = $mappings[$bundle];
         }
         else {
           // If no mapping was found in the database, assign the default RDF
@@ -471,27 +490,17 @@ function rdf_preprocess_node(&$variables) {
   $variables['attributes_array']['about'] = empty($variables['node_url']) ? NULL: $variables['node_url'];
   $variables['attributes_array']['typeof'] = empty($variables['node']->rdf_mapping['rdftype']) ? NULL : $variables['node']->rdf_mapping['rdftype'];
 
-  // Adds RDFa markup to the title of the node. Because the RDFa markup is
-  // added to the <h2> tag which might contain HTML code, we specify an empty
-  // datatype to ensure the value of the title read by the RDFa parsers is a
-  // literal.
-  $variables['title_attributes_array']['property'] = empty($variables['node']->rdf_mapping['title']['predicates']) ? NULL : $variables['node']->rdf_mapping['title']['predicates'];
-  $variables['title_attributes_array']['datatype'] = '';
-
-  // In full node mode, the title is not displayed by node.tpl.php so it is
-  // added in the <head> tag of the HTML page.
-  if ($variables['page']) {
-    $element = array(
-      '#tag' => 'meta',
-      '#attributes' => array(
-        'content' => $variables['node']->title,
-        'about' => $variables['node_url'],
+  // Adds RDFa markup about the title of the node to the title_suffix.
+  if (!empty($variables['node']->rdf_mapping['title']['predicates'])) {
+    $variables['title_suffix']['rdf_meta_title'] = array(
+      '#theme' => 'rdf_metadata',
+      '#metadata' => array(
+        array(
+          'property' => $variables['node']->rdf_mapping['title']['predicates'],
+          'content' => $variables['node']->title,
+        ),
       ),
     );
-    if (!empty($variables['node']->rdf_mapping['title']['predicates'])) {
-      $element['#attributes']['property'] = $variables['node']->rdf_mapping['title']['predicates'];
-    }
-    drupal_add_html_head($element, 'rdf_node_title');
   }
 
   // Adds RDFa markup for the date.
@@ -511,35 +520,20 @@ function rdf_preprocess_node(&$variables) {
   }
 
   // Adds RDFa markup annotating the number of comments a node has.
-  if (isset($variables['node']->comment_count) && !empty($variables['node']->rdf_mapping['comment_count']['predicates'])) {
-    // Annotates the 'x comments' link in teaser view.
-    if (isset($variables['content']['links']['comment']['#links']['comment-comments'])) {
-      $comment_count_attributes['property'] = $variables['node']->rdf_mapping['comment_count']['predicates'];
-      $comment_count_attributes['content'] = $variables['node']->comment_count;
-      $comment_count_attributes['datatype'] = $variables['node']->rdf_mapping['comment_count']['datatype'];
-      // According to RDFa parsing rule number 4, a new subject URI is created
-      // from the href attribute if no rel/rev attribute is present. To get the
-      // original node URL from the about attribute of the parent container we
-      // set an empty rel attribute which triggers rule number 5. See
-      // http://www.w3.org/TR/rdfa-syntax/#sec_5.5.
-      $comment_count_attributes['rel'] = '';
-      $variables['content']['links']['comment']['#links']['comment-comments']['attributes'] += $comment_count_attributes;
-    }
-    // In full node view, the number of comments is not displayed by
-    // node.tpl.php so it is expressed in RDFa in the <head> tag of the HTML
-    // page.
-    if ($variables['page'] && user_access('access comments')) {
-      $element = array(
-        '#tag' => 'meta',
-        '#attributes' => array(
-          'about' => $variables['node_url'],
+  if (isset($variables['node']->comment_count) &&
+      !empty($variables['node']->rdf_mapping['comment_count']['predicates']) &&
+      user_access('access comments')) {
+    // Adds RDFa markup for the comment count near the node title as metadata.
+    $variables['title_suffix']['rdf_meta_comment_count'] = array(
+      '#theme' => 'rdf_metadata',
+      '#metadata' => array(
+        array(
           'property' => $variables['node']->rdf_mapping['comment_count']['predicates'],
           'content' => $variables['node']->comment_count,
           'datatype' => $variables['node']->rdf_mapping['comment_count']['datatype'],
         ),
-      );
-      drupal_add_html_head($element, 'rdf_node_comment_count');
-    }
+      ),
+    );
   }
 }
 
@@ -865,9 +859,9 @@ function theme_rdf_metadata($variables) {
   $output = '';
   foreach ($variables['metadata'] as $attributes) {
     // Add a class so that developers viewing the HTML source can see why there
-    // are empty <span> tags in the document. The class can also be used to set
-    // a CSS display:none rule in a theme where empty spans affect display.
+    // are empty <span> tags in the document.
     $attributes['class'][] = 'rdf-meta';
+    $attributes['class'][] = 'element-hidden';
     // The XHTML+RDFa doctype allows either <span></span> or <span /> syntax to
     // be used, but for maximum browser compatibility, W3C recommends the
     // former when serving pages using the text/html media type, see
diff --git a/drupal7/modules/rdf/rdf.test b/drupal7/modules/rdf/rdf.test
index 370dbb25..22c41f1f 100644
--- a/drupal7/modules/rdf/rdf.test
+++ b/drupal7/modules/rdf/rdf.test
@@ -301,7 +301,7 @@ class RdfMappingDefinitionTestCase extends TaxonomyWebTestCase {
 
     // Ensure the default bundle mapping for node is used. These attributes come
     // from the node default bundle definition.
-    $blog_title = $this->xpath("//meta[@property='dc:title' and @content='$node->title']");
+    $blog_title = $this->xpath("//div[@about='$url']/span[@property='dc:title' and @content='$node->title']");
     $blog_meta = $this->xpath("//div[(@about='$url') and (@typeof='sioct:Weblog')]//span[contains(@property, 'dc:date') and contains(@property, 'dc:created') and @datatype='xsd:dateTime' and @content='$isoDate']");
     $this->assertTrue(!empty($blog_title), 'Property dc:title is present in meta tag.');
     $this->assertTrue(!empty($blog_meta), 'RDF type is present on post. Properties dc:date and dc:created are present on post date.');
@@ -324,7 +324,7 @@ class RdfMappingDefinitionTestCase extends TaxonomyWebTestCase {
     $this->drupalGet('node/' . $node->nid);
 
     // Ensure the mapping defined in rdf_module.test is used.
-    $test_bundle_title = $this->xpath('//meta[@property="dc:title" and @content="' . $node->title . '"]');
+    $test_bundle_title = $this->xpath("//div[@about='$url']/span[@property='dc:title' and @content=\"$node->title\"]");
     $test_bundle_meta = $this->xpath("//div[(@about='$url') and contains(@typeof, 'foo:mapping_install1') and contains(@typeof, 'bar:mapping_install2')]//span[contains(@property, 'dc:date') and contains(@property, 'dc:created') and @datatype='xsd:dateTime' and @content='$isoDate']");
     $this->assertTrue(!empty($test_bundle_title), 'Property dc:title is present in meta tag.');
     $this->assertTrue(!empty($test_bundle_meta), 'RDF type is present on post. Properties dc:date and dc:created are present on post date.');
@@ -343,7 +343,7 @@ class RdfMappingDefinitionTestCase extends TaxonomyWebTestCase {
 
     // Ensure the default bundle mapping for node is used. These attributes come
     // from the node default bundle definition.
-    $random_bundle_title = $this->xpath("//meta[@property='dc:title' and @content='$node->title']");
+    $random_bundle_title = $this->xpath("//div[@about='$url']/span[@property='dc:title' and @content='$node->title']");
     $random_bundle_meta = $this->xpath("//div[(@about='$url') and contains(@typeof, 'sioc:Item') and contains(@typeof, 'foaf:Document')]//span[contains(@property, 'dc:date') and contains(@property, 'dc:created') and @datatype='xsd:dateTime' and @content='$isoDate']");
     $this->assertTrue(!empty($random_bundle_title), 'Property dc:title is present in meta tag.');
     $this->assertTrue(!empty($random_bundle_meta), 'RDF type is present on post. Properties dc:date and dc:created are present on post date.');
@@ -461,15 +461,13 @@ class RdfCommentAttributesTestCase extends CommentHelperCase {
 
     // Tests number of comments in teaser view.
     $this->drupalGet('node');
-    $comment_count_teaser = $this->xpath('//div[contains(@typeof, "sioc:Item")]//li[contains(@class, "comment-comments")]/a[contains(@property, "sioc:num_replies") and contains(@content, "2") and @datatype="xsd:integer"]');
+    $node_url = url('node/' . $this->node1->nid);
+    $comment_count_teaser = $this->xpath('//div[@about=:node-url]/span[@property="sioc:num_replies" and @content="2" and @datatype="xsd:integer"]', array(':node-url' => $node_url));
     $this->assertTrue(!empty($comment_count_teaser), 'RDFa markup for the number of comments found on teaser view.');
-    $comment_count_link = $this->xpath('//div[@about=:url]//a[contains(@property, "sioc:num_replies") and @rel=""]', array(':url' => url("node/{$this->node1->nid}")));
-    $this->assertTrue(!empty($comment_count_link), 'Empty rel attribute found in comment count link.');
 
     // Tests number of comments in full node view.
     $this->drupalGet('node/' . $this->node1->nid);
-    $node_url = url('node/' . $this->node1->nid);
-    $comment_count_teaser = $this->xpath('/html/head/meta[@about=:node-url and @property="sioc:num_replies" and @content="2" and @datatype="xsd:integer"]', array(':node-url' => $node_url));
+    $comment_count_teaser = $this->xpath('//div[@about=:node-url]/span[@property="sioc:num_replies" and @content="2" and @datatype="xsd:integer"]', array(':node-url' => $node_url));
     $this->assertTrue(!empty($comment_count_teaser), 'RDFa markup for the number of comments found on full node view.');
   }
 
diff --git a/drupal7/modules/rdf/tests/rdf_test.info b/drupal7/modules/rdf/tests/rdf_test.info
index 6c9c845c..8a755df5 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/search/search.info b/drupal7/modules/search/search.info
index 31182225..0362b4d9 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/search/tests/search_embedded_form.info b/drupal7/modules/search/tests/search_embedded_form.info
index d49303f5..b1dd94f5 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/search/tests/search_extra_type.info b/drupal7/modules/search/tests/search_extra_type.info
index cc6536d5..a7620ccd 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/shortcut/shortcut.info b/drupal7/modules/shortcut/shortcut.info
index 64d7abd5..c51fa25e 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/drupal_web_test_case.php b/drupal7/modules/simpletest/drupal_web_test_case.php
index 8022bf32..8ecddb50 100644
--- a/drupal7/modules/simpletest/drupal_web_test_case.php
+++ b/drupal7/modules/simpletest/drupal_web_test_case.php
@@ -143,15 +143,7 @@ abstract class DrupalTestCase {
     );
 
     // Store assertion for display after the test has completed.
-    try {
-      $connection = Database::getConnection('default', 'simpletest_original_default');
-    }
-    catch (DatabaseConnectionNotDefinedException $e) {
-      // If the test was not set up, the simpletest_original_default
-      // connection does not exist.
-      $connection = Database::getConnection('default', 'default');
-    }
-    $connection
+    self::getDatabaseConnection()
       ->insert('simpletest')
       ->fields($assertion)
       ->execute();
@@ -166,6 +158,25 @@ abstract class DrupalTestCase {
     }
   }
 
+  /**
+   * Returns the database connection to the site running Simpletest.
+   *
+   * @return DatabaseConnection
+   *   The database connection to use for inserting assertions.
+   */
+  public static function getDatabaseConnection() {
+    try {
+      $connection = Database::getConnection('default', 'simpletest_original_default');
+    }
+    catch (DatabaseConnectionNotDefinedException $e) {
+      // If the test was not set up, the simpletest_original_default
+      // connection does not exist.
+      $connection = Database::getConnection('default', 'default');
+    }
+
+    return $connection;
+  }
+
   /**
    * Store an assertion from outside the testing context.
    *
@@ -205,7 +216,8 @@ abstract class DrupalTestCase {
       'file' => $caller['file'],
     );
 
-    return db_insert('simpletest')
+    return self::getDatabaseConnection()
+      ->insert('simpletest')
       ->fields($assertion)
       ->execute();
   }
@@ -221,7 +233,8 @@ abstract class DrupalTestCase {
    * @see DrupalTestCase::insertAssert()
    */
   public static function deleteAssert($message_id) {
-    return (bool) db_delete('simpletest')
+    return (bool) self::getDatabaseConnection()
+      ->delete('simpletest')
       ->condition('message_id', $message_id)
       ->execute();
   }
@@ -435,10 +448,10 @@ abstract class DrupalTestCase {
   }
 
   /**
-   * Logs verbose message in a text file.
+   * Logs a verbose message in a text file.
    *
-   * The a link to the vebose message will be placed in the test results via
-   * as a passing assertion with the text '[verbose message]'.
+   * The link to the verbose message will be placed in the test results as a
+   * passing assertion with the text '[verbose message]'.
    *
    * @param $message
    *   The verbose message to be stored.
@@ -2288,6 +2301,8 @@ class DrupalWebTestCase extends DrupalTestCase {
             break;
           case 'restripe':
             break;
+          case 'add_css':
+            break;
         }
       }
       $content = $dom->saveHTML();
@@ -2682,28 +2697,26 @@ class DrupalWebTestCase extends DrupalTestCase {
    *
    * Will click the first link found with this link text by default, or a later
    * one if an index is given. Match is case sensitive with normalized space.
-   * The label is translated label. There is an assert for successful click.
+   * The label is translated label.
+   *
+   * If the link is discovered and clicked, the test passes. Fail otherwise.
    *
    * @param $label
    *   Text between the anchor tags.
    * @param $index
    *   Link position counting from zero.
    * @return
-   *   Page on success, or FALSE on failure.
+   *   Page contents on success, or FALSE on failure.
    */
   protected function clickLink($label, $index = 0) {
     $url_before = $this->getUrl();
     $urls = $this->xpath('//a[normalize-space(text())=:label]', array(':label' => $label));
-
     if (isset($urls[$index])) {
       $url_target = $this->getAbsoluteUrl($urls[$index]['href']);
-    }
-
-    $this->assertTrue(isset($urls[$index]), t('Clicked link %label (@url_target) from @url_before', array('%label' => $label, '@url_target' => $url_target, '@url_before' => $url_before)), t('Browser'));
-
-    if (isset($url_target)) {
+      $this->pass(t('Clicked link %label (@url_target) from @url_before', array('%label' => $label, '@url_target' => $url_target, '@url_before' => $url_before)), 'Browser');
       return $this->drupalGet($url_target);
     }
+    $this->fail(t('Link %label does not exist on @url_before', array('%label' => $label, '@url_before' => $url_before)), 'Browser');
     return FALSE;
   }
 
diff --git a/drupal7/modules/simpletest/files/css_test_files/css_input_with_import.css.optimized.css b/drupal7/modules/simpletest/files/css_test_files/css_input_with_import.css.optimized.css
index 698d9aa6..a05f939f 100644
--- a/drupal7/modules/simpletest/files/css_test_files/css_input_with_import.css.optimized.css
+++ b/drupal7/modules/simpletest/files/css_test_files/css_input_with_import.css.optimized.css
@@ -1,4 +1,4 @@
-ul,select{font:1em/160% Verdana,sans-serif;color:#494949;}.ui-icon{background-image:url(images/icon.png);}
+ul,select{font:1em/160% Verdana,sans-serif;color:#494949;}.ui-icon{background-image:url(images/icon.png);}.data .double-quote{background-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");}.data .single-quote{background-image:url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACAWGBwYFCAcGhwkIiAmMFA0MCwsMGJGSjpQdGZ6eHJmcG6AkLicgIiuim5woNqirr7EztDOfJri8uDI8LjKzsb/2wBDASIkJDAqMF40NF7GhHCExsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsb/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAH//Z');}.data .no-quote{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAEAQAAAAAo/mtHAAAAIElEQVQIHWMRnWHwcRNLN8NZ7QYWwT8PlBlYsgqVBRsAankIMw5MtnoAAAAASUVORK5CYII=);}
 p,select{font:1em/160% Verdana,sans-serif;color:#494949;}
 body{margin:0;padding:0;background:#edf5fa;font:76%/170% Verdana,sans-serif;color:#494949;}.this .is .a .test{font:1em/100% Verdana,sans-serif;color:#494949;}.this
 .is
diff --git a/drupal7/modules/simpletest/files/css_test_files/css_input_with_import.css.unoptimized.css b/drupal7/modules/simpletest/files/css_test_files/css_input_with_import.css.unoptimized.css
index 19323c12..b8c7778d 100644
--- a/drupal7/modules/simpletest/files/css_test_files/css_input_with_import.css.unoptimized.css
+++ b/drupal7/modules/simpletest/files/css_test_files/css_input_with_import.css.unoptimized.css
@@ -7,6 +7,21 @@ ul, select {
 }
 .ui-icon{background-image: url(images/icon.png);}
 
+/* Test data URI images with different quote styles. */
+.data .double-quote {
+  /* http://stackoverflow.com/a/13139830/11023 */
+  background-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
+}
+
+.data .single-quote {
+  background-image: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACAWGBwYFCAcGhwkIiAmMFA0MCwsMGJGSjpQdGZ6eHJmcG6AkLicgIiuim5woNqirr7EztDOfJri8uDI8LjKzsb/2wBDASIkJDAqMF40NF7GhHCExsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsb/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAH//Z');
+}
+
+.data .no-quote {
+  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAEAQAAAAAo/mtHAAAAIElEQVQIHWMRnWHwcRNLN8NZ7QYWwT8PlBlYsgqVBRsAankIMw5MtnoAAAAASUVORK5CYII=);
+}
+
+
 p, select {
   font: 1em/160% Verdana, sans-serif;
   color: #494949;
diff --git a/drupal7/modules/simpletest/files/css_test_files/css_subfolder/css_input_with_import.css.optimized.css b/drupal7/modules/simpletest/files/css_test_files/css_subfolder/css_input_with_import.css.optimized.css
index aba3b210..816039dc 100644
--- a/drupal7/modules/simpletest/files/css_test_files/css_subfolder/css_input_with_import.css.optimized.css
+++ b/drupal7/modules/simpletest/files/css_test_files/css_subfolder/css_input_with_import.css.optimized.css
@@ -1,4 +1,4 @@
-ul,select{font:1em/160% Verdana,sans-serif;color:#494949;}.ui-icon{background-image:url(../images/icon.png);}
+ul,select{font:1em/160% Verdana,sans-serif;color:#494949;}.ui-icon{background-image:url(../images/icon.png);}.data .double-quote{background-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");}.data .single-quote{background-image:url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACAWGBwYFCAcGhwkIiAmMFA0MCwsMGJGSjpQdGZ6eHJmcG6AkLicgIiuim5woNqirr7EztDOfJri8uDI8LjKzsb/2wBDASIkJDAqMF40NF7GhHCExsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsb/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAH//Z');}.data .no-quote{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAEAQAAAAAo/mtHAAAAIElEQVQIHWMRnWHwcRNLN8NZ7QYWwT8PlBlYsgqVBRsAankIMw5MtnoAAAAASUVORK5CYII=);}
 p,select{font:1em/160% Verdana,sans-serif;color:#494949;}
 body{margin:0;padding:0;background:#edf5fa;font:76%/170% Verdana,sans-serif;color:#494949;}.this .is .a .test{font:1em/100% Verdana,sans-serif;color:#494949;}.this
 .is
diff --git a/drupal7/modules/simpletest/files/css_test_files/css_subfolder/css_input_with_import.css.unoptimized.css b/drupal7/modules/simpletest/files/css_test_files/css_subfolder/css_input_with_import.css.unoptimized.css
index 710d8f14..6d7151bb 100644
--- a/drupal7/modules/simpletest/files/css_test_files/css_subfolder/css_input_with_import.css.unoptimized.css
+++ b/drupal7/modules/simpletest/files/css_test_files/css_subfolder/css_input_with_import.css.unoptimized.css
@@ -7,6 +7,21 @@ ul, select {
 }
 .ui-icon{background-image: url(../images/icon.png);}
 
+/* Test data URI images with different quote styles. */
+.data .double-quote {
+  /* http://stackoverflow.com/a/13139830/11023 */
+  background-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
+}
+
+.data .single-quote {
+  background-image: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACAWGBwYFCAcGhwkIiAmMFA0MCwsMGJGSjpQdGZ6eHJmcG6AkLicgIiuim5woNqirr7EztDOfJri8uDI8LjKzsb/2wBDASIkJDAqMF40NF7GhHCExsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsb/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAH//Z');
+}
+
+.data .no-quote {
+  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAEAQAAAAAo/mtHAAAAIElEQVQIHWMRnWHwcRNLN8NZ7QYWwT8PlBlYsgqVBRsAankIMw5MtnoAAAAASUVORK5CYII=);
+}
+
+
 p, select {
   font: 1em/160% Verdana, sans-serif;
   color: #494949;
diff --git a/drupal7/modules/simpletest/files/css_test_files/import1.css b/drupal7/modules/simpletest/files/css_test_files/import1.css
index 3d5842ec..e53d6d52 100644
--- a/drupal7/modules/simpletest/files/css_test_files/import1.css
+++ b/drupal7/modules/simpletest/files/css_test_files/import1.css
@@ -3,4 +3,18 @@ ul, select {
   font: 1em/160% Verdana, sans-serif;
   color: #494949;
 }
-.ui-icon{background-image: url(images/icon.png);}
\ No newline at end of file
+.ui-icon{background-image: url(images/icon.png);}
+
+/* Test data URI images with different quote styles. */
+.data .double-quote {
+  /* http://stackoverflow.com/a/13139830/11023 */
+  background-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
+}
+
+.data .single-quote {
+  background-image: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACAWGBwYFCAcGhwkIiAmMFA0MCwsMGJGSjpQdGZ6eHJmcG6AkLicgIiuim5woNqirr7EztDOfJri8uDI8LjKzsb/2wBDASIkJDAqMF40NF7GhHCExsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsb/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAH//Z');
+}
+
+.data .no-quote {
+  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAEAQAAAAAo/mtHAAAAIElEQVQIHWMRnWHwcRNLN8NZ7QYWwT8PlBlYsgqVBRsAankIMw5MtnoAAAAASUVORK5CYII=);
+}
diff --git a/drupal7/modules/simpletest/simpletest.info b/drupal7/modules/simpletest/simpletest.info
index 5090faf9..e3a80c6e 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/actions_loop_test.info b/drupal7/modules/simpletest/tests/actions_loop_test.info
index 39e7506d..5e712734 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/ajax.test b/drupal7/modules/simpletest/tests/ajax.test
index a0c7be8a..c38a325f 100644
--- a/drupal7/modules/simpletest/tests/ajax.test
+++ b/drupal7/modules/simpletest/tests/ajax.test
@@ -368,6 +368,14 @@ class AJAXCommandsTestCase extends AJAXTestCase {
       'settings' => array('ajax_forms_test' => array('foo' => 42)),
     );
     $this->assertCommand($commands, $expected, "'settings' AJAX command issued with correct data");
+
+    // Tests the 'add_css' command.
+    $commands = $this->drupalPostAJAX($form_path, $edit, array('op' => t("AJAX 'add_css' command")));
+    $expected = array(
+      'command' => 'add_css',
+      'data' => 'my/file.css',
+    );
+    $this->assertCommand($commands, $expected, "'add_css' AJAX command issued with correct data");
   }
 }
 
diff --git a/drupal7/modules/simpletest/tests/ajax_forms_test.info b/drupal7/modules/simpletest/tests/ajax_forms_test.info
index 2eed3f54..fa96ccca 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/ajax_forms_test.module b/drupal7/modules/simpletest/tests/ajax_forms_test.module
index 28404224..260d9112 100644
--- a/drupal7/modules/simpletest/tests/ajax_forms_test.module
+++ b/drupal7/modules/simpletest/tests/ajax_forms_test.module
@@ -254,6 +254,15 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
     ),
   );
 
+  // Shows the Ajax 'add_css' command.
+  $form['add_css_command_example'] = array(
+    '#type' => 'submit',
+    '#value' => t("AJAX 'add_css' command"),
+    '#ajax' => array(
+      'callback' => 'ajax_forms_test_advanced_commands_add_css_callback',
+    ),
+  );
+
   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Submit'),
@@ -406,6 +415,15 @@ function ajax_forms_test_advanced_commands_settings_callback($form, $form_state)
   return array('#type' => 'ajax', '#commands' => $commands);
 }
 
+/**
+ * Ajax callback for 'add_css'.
+ */
+function ajax_forms_test_advanced_commands_add_css_callback($form, $form_state) {
+  $commands = array();
+  $commands[] = ajax_command_add_css('my/file.css');
+  return array('#type' => 'ajax', '#commands' => $commands);
+}
+
 /**
  * This form and its related submit and callback functions demonstrate
  * not validating another form element when a single Ajax element is triggered.
diff --git a/drupal7/modules/simpletest/tests/ajax_test.info b/drupal7/modules/simpletest/tests/ajax_test.info
index d14a1898..75779eb5 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/batch_test.info b/drupal7/modules/simpletest/tests/batch_test.info
index 32ac1309..5553ca19 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/bootstrap.test b/drupal7/modules/simpletest/tests/bootstrap.test
index 5dcde325..f723c630 100644
--- a/drupal7/modules/simpletest/tests/bootstrap.test
+++ b/drupal7/modules/simpletest/tests/bootstrap.test
@@ -144,7 +144,7 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
     $this->assertResponse(200, 'Conditional request without If-None-Match returned 200 OK.');
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
 
-    $this->drupalGet('', array(), array('If-Modified-Since: ' . gmdate(DATE_RFC1123, strtotime($last_modified) + 1), 'If-None-Match: ' . $etag));
+    $this->drupalGet('', array(), array('If-Modified-Since: ' . gmdate(DATE_RFC7231, strtotime($last_modified) + 1), 'If-None-Match: ' . $etag));
     $this->assertResponse(200, 'Conditional request with new a If-Modified-Since date newer than Last-Modified returned 200 OK.');
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
 
diff --git a/drupal7/modules/simpletest/tests/common.test b/drupal7/modules/simpletest/tests/common.test
index f6e03b00..eebfdbe4 100644
--- a/drupal7/modules/simpletest/tests/common.test
+++ b/drupal7/modules/simpletest/tests/common.test
@@ -661,6 +661,10 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
     drupal_add_css($css);
     $styles = drupal_get_css();
     $this->assertTrue(strpos($styles, $css) > 0, 'Rendered CSS includes the added stylesheet.');
+    // Verify that newlines are properly added inside style tags.
+    $query_string = variable_get('css_js_query_string', '0');
+    $css_processed = "<style type=\"text/css\" media=\"all\">\n@import url(\"" . check_plain(file_create_url($css)) . "?" . $query_string ."\");\n</style>";
+    $this->assertEqual(trim($styles), $css_processed, 'Rendered CSS includes newlines inside style tags for JavaScript use.');
   }
 
   /**
@@ -914,9 +918,10 @@ class CascadingStylesheetsUnitTest extends DrupalUnitTestCase {
    * Tests basic CSS loading with and without optimization via drupal_load_stylesheet().
    *
    * Known tests:
-   * - Retain white-space in selectors. (http://drupal.org/node/472820)
-   * - Proper URLs in imported files. (http://drupal.org/node/265719)
-   * - Retain pseudo-selectors. (http://drupal.org/node/460448)
+   * - Retain white-space in selectors. (https://drupal.org/node/472820)
+   * - Proper URLs in imported files. (https://drupal.org/node/265719)
+   * - Retain pseudo-selectors. (https://drupal.org/node/460448)
+   * - Don't adjust data URIs. (https://drupal.org/node/2142441)
    */
   function testLoadCssBasic() {
     // Array of files to test living in 'simpletest/files/css_test_files/'.
@@ -1082,6 +1087,74 @@ class DrupalHTTPRequestTestCase extends DrupalWebTestCase {
   }
 }
 
+/**
+ * Tests parsing of the HTTP response status line.
+ */
+class DrupalHTTPResponseStatusLineTest extends DrupalUnitTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Drupal HTTP request response status parsing',
+      'description' => 'Perform unit tests on _drupal_parse_response_status().',
+      'group' => 'System',
+    );
+  }
+
+  /**
+   * Tests parsing HTTP response status line.
+   */
+  public function testStatusLine() {
+    // Grab the big array of test data from statusLineData().
+    $data = $this->statusLineData();
+    foreach($data as $test_case) {
+      $test_data = array_shift($test_case);
+      $expected = array_shift($test_case);
+
+      $outcome = _drupal_parse_response_status($test_data);
+
+      foreach(array_keys($expected) as $key) {
+        $this->assertIdentical($outcome[$key], $expected[$key]);
+      }
+    }
+  }
+
+  /**
+   * Data provider for testStatusLine().
+   *
+   * @return array
+   *   Test data.
+   */
+  protected function statusLineData() {
+    return array(
+      array(
+        'HTTP/1.1 200 OK',
+        array(
+          'http_version' => 'HTTP/1.1',
+          'response_code' => '200',
+          'reason_phrase' => 'OK',
+        ),
+      ),
+      // Data set with no reason phrase.
+      array(
+        'HTTP/1.1 200',
+        array(
+          'http_version' => 'HTTP/1.1',
+          'response_code' => '200',
+          'reason_phrase' => '',
+        ),
+      ),
+      // Arbitrary strings.
+      array(
+        'version code multi word explanation',
+        array(
+          'http_version' => 'version',
+          'response_code' => 'code',
+          'reason_phrase' => 'multi word explanation',
+        ),
+      ),
+    );
+  }
+}
+
 /**
  * Testing drupal_add_region_content and drupal_get_region_content.
  */
diff --git a/drupal7/modules/simpletest/tests/common_test.info b/drupal7/modules/simpletest/tests/common_test.info
index 527234ba..09fcf014 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/common_test_cron_helper.info b/drupal7/modules/simpletest/tests/common_test_cron_helper.info
index 44b084c5..fdc2a236 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/database_test.info b/drupal7/modules/simpletest/tests/database_test.info
index 526c3cf5..5c422f91 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/database_test.test b/drupal7/modules/simpletest/tests/database_test.test
index 209bf681..12ddb343 100644
--- a/drupal7/modules/simpletest/tests/database_test.test
+++ b/drupal7/modules/simpletest/tests/database_test.test
@@ -1947,6 +1947,15 @@ class DatabaseSelectOrderedTestCase extends DatabaseTestCase {
 
     $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
   }
+
+  /**
+   * Tests that the sort direction is sanitized properly.
+   */
+  function testOrderByEscaping() {
+    $query = db_select('test')->orderBy('name', 'invalid direction');
+    $order_bys = $query->getOrderBy();
+    $this->assertEqual($order_bys['name'], 'ASC', 'Invalid order by direction is converted to ASC.');
+  }
 }
 
 /**
@@ -3391,7 +3400,7 @@ class DatabaseQueryTestCase extends DatabaseTestCase {
   public function testArrayArgumentsSQLInjection() {
     // Attempt SQL injection and verify that it does not work.
     $condition = array(
-      "1 ;INSERT INTO {test} SET name = 'test12345678'; -- " => '',
+      "1 ;INSERT INTO {test} (name) VALUES ('test12345678'); -- " => '',
       '1' => '',
     );
     try {
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 11592aa6..cd1a8187 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 758948b5..2a26a133 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/entity_cache_test.info b/drupal7/modules/simpletest/tests/entity_cache_test.info
index 1a1408e6..3ae8f5eb 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/entity_cache_test_dependency.info b/drupal7/modules/simpletest/tests/entity_cache_test_dependency.info
index b26f9bd5..80ed2a28 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/entity_crud_hook_test.info b/drupal7/modules/simpletest/tests/entity_crud_hook_test.info
index 694e922e..4f57a2e2 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/entity_query_access_test.info b/drupal7/modules/simpletest/tests/entity_query_access_test.info
index bc96477b..97b49920 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/error_test.info b/drupal7/modules/simpletest/tests/error_test.info
index 61d217fd..52c09a5d 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/file.test b/drupal7/modules/simpletest/tests/file.test
index 20dd2737..b75327f1 100644
--- a/drupal7/modules/simpletest/tests/file.test
+++ b/drupal7/modules/simpletest/tests/file.test
@@ -484,14 +484,6 @@ class FileValidatorTest extends DrupalWebTestCase {
     $original_user = $user;
     drupal_save_session(FALSE);
 
-    // Run these test as uid = 1.
-    $user = user_load(1);
-
-    $file = new stdClass();
-    $file->filesize = 999999;
-    $errors = file_validate_size($file, 1, 1);
-    $this->assertEqual(count($errors), 0, 'No size limits enforced on uid=1.', 'File');
-
     // Run these tests as a regular user.
     $user = $this->drupalCreateUser();
 
@@ -2564,6 +2556,7 @@ class FileNameMungingTest extends FileTestCase {
     parent::setUp();
     $this->bad_extension = 'php';
     $this->name = $this->randomName() . '.' . $this->bad_extension . '.txt';
+    $this->name_with_uc_ext = $this->randomName() . '.' . strtoupper($this->bad_extension) . '.txt';
   }
 
   /**
@@ -2601,9 +2594,13 @@ class FileNameMungingTest extends FileTestCase {
    * White listed extensions are ignored by file_munge_filename().
    */
   function testMungeIgnoreWhitelisted() {
-    // Declare our extension as whitelisted.
-    $munged_name = file_munge_filename($this->name, $this->bad_extension);
-    $this->assertIdentical($munged_name, $this->name, format_string('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', array('%munged' => $munged_name, '%original' => $this->name)));
+    // Declare our extension as whitelisted. The declared extensions should
+    // be case insensitive so test using one with a different case.
+    $munged_name = file_munge_filename($this->name_with_uc_ext, $this->bad_extension);
+    $this->assertIdentical($munged_name, $this->name_with_uc_ext, format_string('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', array('%munged' => $munged_name, '%original' => $this->name_with_uc_ext)));
+    // The allowed extensions should also be normalized.
+    $munged_name = file_munge_filename($this->name, strtoupper($this->bad_extension));
+    $this->assertIdentical($munged_name, $this->name, format_string('The new filename (%munged) matches the original (%original) also when the whitelisted extension is in uppercase.', array('%munged' => $munged_name, '%original' => $this->name)));
   }
 
   /**
diff --git a/drupal7/modules/simpletest/tests/file_test.info b/drupal7/modules/simpletest/tests/file_test.info
index 2e0f4bd7..20881f12 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/filter_test.info b/drupal7/modules/simpletest/tests/filter_test.info
index 6cdc7dc2..ebe2bc2b 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/form_test.info b/drupal7/modules/simpletest/tests/form_test.info
index 8e756981..6c7b501f 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/image_test.info b/drupal7/modules/simpletest/tests/image_test.info
index eb49c083..c10a8f2f 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/menu_test.info b/drupal7/modules/simpletest/tests/menu_test.info
index 3fd7234e..87e7e934 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/module_test.info b/drupal7/modules/simpletest/tests/module_test.info
index 7caa52d1..372fce3a 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/path_test.info b/drupal7/modules/simpletest/tests/path_test.info
index 05f10630..d7608a8c 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 648bf9de..5725ebd9 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/requirements1_test.info b/drupal7/modules/simpletest/tests/requirements1_test.info
index 6a8c4ebc..7d8c6ae9 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/requirements2_test.info b/drupal7/modules/simpletest/tests/requirements2_test.info
index 3a40b0e3..e424b162 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/session_test.info b/drupal7/modules/simpletest/tests/session_test.info
index eeb5984d..609803f6 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/system_dependencies_test.info b/drupal7/modules/simpletest/tests/system_dependencies_test.info
index 7cf67e6e..58401850 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 883e6672..59acdeec 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 86b0f0f9..87a10010 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 f1d577ad..c5b220ae 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 049ffbaa..5e02ad7e 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/system_test.info b/drupal7/modules/simpletest/tests/system_test.info
index d4473ac5..b61d8a45 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/taxonomy_test.info b/drupal7/modules/simpletest/tests/taxonomy_test.info
index 7961cc29..3f4eb191 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/theme.test b/drupal7/modules/simpletest/tests/theme.test
index 519a7a90..f1a743e0 100644
--- a/drupal7/modules/simpletest/tests/theme.test
+++ b/drupal7/modules/simpletest/tests/theme.test
@@ -425,28 +425,100 @@ class ThemeFastTestCase extends DrupalWebTestCase {
 }
 
 /**
- * Unit tests for theme_html_tag().
+ * Tests the markup of core render element types passed to drupal_render().
  */
-class ThemeHtmlTag extends DrupalUnitTestCase {
+class RenderElementTypesTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
-      'name' => 'Theme HTML Tag',
-      'description' => 'Tests theme_html_tag() built-in theme functions.',
+      'name' => 'Render element types',
+      'description' => 'Tests the markup of core render element types passed to drupal_render().',
       'group' => 'Theme',
     );
   }
 
   /**
-   * Test function theme_html_tag()
+   * Asserts that an array of elements is rendered properly.
+   *
+   * @param array $elements
+   *   An array of associative arrays describing render elements and their
+   *   expected markup. Each item in $elements must contain the following:
+   *   - 'name': This human readable description will be displayed on the test
+   *     results page.
+   *   - 'value': This is the render element to test.
+   *   - 'expected': This is the expected markup for the element in 'value'.
+   */
+  function assertElements($elements) {
+    foreach($elements as $element) {
+      $this->assertIdentical(drupal_render($element['value']), $element['expected'], '"' . $element['name'] . '" input rendered correctly by drupal_render().');
+    }
+  }
+
+  /**
+   * Tests system #type 'container'.
+   */
+  function testContainer() {
+    $elements = array(
+      // Basic container with no attributes.
+      array(
+        'name' => "#type 'container' with no HTML attributes",
+        'value' => array(
+          '#type' => 'container',
+          'child' => array(
+            '#markup' => 'foo',
+          ),
+        ),
+        'expected' => '<div>foo</div>',
+      ),
+      // Container with a class.
+      array(
+        'name' => "#type 'container' with a class HTML attribute",
+        'value' => array(
+          '#type' => 'container',
+          'child' => array(
+            '#markup' => 'foo',
+          ),
+          '#attributes' => array(
+            'class' => 'bar',
+          ),
+        ),
+        'expected' => '<div class="bar">foo</div>',
+      ),
+    );
+
+    $this->assertElements($elements);
+  }
+
+  /**
+   * Tests system #type 'html_tag'.
    */
-  function testThemeHtmlTag() {
-    // Test auto-closure meta tag generation
-    $tag['element'] = array('#tag' => 'meta', '#attributes' => array('name' => 'description', 'content' => 'Drupal test'));
-    $this->assertEqual('<meta name="description" content="Drupal test" />'."\n", theme_html_tag($tag), 'Test auto-closure meta tag generation.');
+  function testHtmlTag() {
+    $elements = array(
+      // Test auto-closure meta tag generation.
+      array(
+        'name' => "#type 'html_tag' auto-closure meta tag generation",
+        'value' => array(
+          '#type' => 'html_tag',
+          '#tag' => 'meta',
+          '#attributes' => array(
+            'name' => 'description',
+            'content' => 'Drupal test',
+          ),
+        ),
+        'expected' => '<meta name="description" content="Drupal test" />' . "\n",
+      ),
+      // Test title tag generation.
+      array(
+        'name' => "#type 'html_tag' title tag generation",
+        'value' => array(
+          '#type' => 'html_tag',
+          '#tag' => 'title',
+          '#value' => 'title test',
+        ),
+        'expected' => '<title>title test</title>' . "\n",
+      ),
+    );
 
-    // Test title tag generation
-    $tag['element'] = array('#tag' => 'title', '#value' => 'title test');
-    $this->assertEqual('<title>title test</title>'."\n", theme_html_tag($tag), 'Test title tag generation.');
+    $this->assertElements($elements);
   }
 }
 
@@ -500,3 +572,68 @@ class ThemeRegistryTestCase extends DrupalWebTestCase {
     $this->assertTrue($registry['theme_test_template_test_2'], 'Offset was returned correctly from the theme registry');
   }
 }
+
+/**
+ * Tests for theme debug markup.
+ */
+class ThemeDebugMarkupTestCase extends DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Theme debug markup',
+      'description' => 'Tests theme debug markup output.',
+      'group' => 'Theme',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('theme_test', 'node');
+    theme_enable(array('test_theme'));
+  }
+
+  /**
+   * Tests debug markup added to template output.
+   */
+  function testDebugOutput() {
+    variable_set('theme_default', 'test_theme');
+    // Enable the debug output.
+    variable_set('theme_debug', TRUE);
+
+    $registry = theme_get_registry();
+    $extension = '.tpl.php';
+    // Populate array of templates.
+    $templates = drupal_find_theme_templates($registry, $extension, drupal_get_path('theme', 'test_theme'));
+    $templates += drupal_find_theme_templates($registry, $extension, drupal_get_path('module', 'node'));
+
+    // Create a node and test different features of the debug markup.
+    $node = $this->drupalCreateNode();
+    $this->drupalGet('node/' . $node->nid);
+    $this->assertRaw('<!-- THEME DEBUG -->', 'Theme debug markup found in theme output when debug is enabled.');
+    $this->assertRaw("CALL: theme('node')", 'Theme call information found.');
+    $this->assertRaw('x node--1' . $extension . PHP_EOL . '   * node--page' . $extension . PHP_EOL . '   * node' . $extension, 'Suggested template files found in order and node ID specific template shown as current template.');
+    $template_filename = $templates['node__1']['path'] . '/' . $templates['node__1']['template'] . $extension;
+    $this->assertRaw("BEGIN OUTPUT from '$template_filename'", 'Full path to current template file found.');
+
+    // Create another node and make sure the template suggestions shown in the
+    // debug markup are correct.
+    $node2 = $this->drupalCreateNode();
+    $this->drupalGet('node/' . $node2->nid);
+    $this->assertRaw('* node--2' . $extension . PHP_EOL . '   * node--page' . $extension . PHP_EOL . '   x node' . $extension, 'Suggested template files found in order and base template shown as current template.');
+
+    // Create another node and make sure the template suggestions shown in the
+    // debug markup are correct.
+    $node3 = $this->drupalCreateNode();
+    $build = array('#theme' => 'node__foo__bar');
+    $build += node_view($node3);
+    $output = drupal_render($build);
+    $this->assertTrue(strpos($output, "CALL: theme('node__foo__bar')") !== FALSE, 'Theme call information found.');
+    $this->assertTrue(strpos($output, '* node--foo--bar' . $extension . PHP_EOL . '   * node--foo' . $extension . PHP_EOL . '   * node--3' . $extension . PHP_EOL . '   * node--page' . $extension . PHP_EOL . '   x node' . $extension) !== FALSE, 'Suggested template files found in order and base template shown as current template.');
+
+    // Disable theme debug.
+    variable_set('theme_debug', FALSE);
+
+    $this->drupalGet('node/' . $node->nid);
+    $this->assertNoRaw('<!-- THEME DEBUG -->', 'Theme debug markup not found in theme output when debug is disabled.');
+  }
+
+}
diff --git a/drupal7/modules/simpletest/tests/theme_test.info b/drupal7/modules/simpletest/tests/theme_test.info
index eb3bf87e..93ea498b 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 c2bb2dcc..0b32f6a3 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 fa146992..d273b024 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/themes/test_theme/templates/node--1.tpl.php b/drupal7/modules/simpletest/tests/themes/test_theme/templates/node--1.tpl.php
new file mode 100644
index 00000000..87aa7947
--- /dev/null
+++ b/drupal7/modules/simpletest/tests/themes/test_theme/templates/node--1.tpl.php
@@ -0,0 +1,2 @@
+<!-- Output for Theme Debug Markup test -->
+Node Content Dummy
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 4f459b48..86593551 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/update_script_test.info b/drupal7/modules/simpletest/tests/update_script_test.info
index 27a49fb8..cb0abd51 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/update_test_1.info b/drupal7/modules/simpletest/tests/update_test_1.info
index f7725ca3..59b7154f 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/update_test_2.info b/drupal7/modules/simpletest/tests/update_test_2.info
index f7725ca3..59b7154f 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/update_test_3.info b/drupal7/modules/simpletest/tests/update_test_3.info
index f7725ca3..59b7154f 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/url_alter_test.info b/drupal7/modules/simpletest/tests/url_alter_test.info
index b2363869..3afc9f49 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/simpletest/tests/xmlrpc_test.info b/drupal7/modules/simpletest/tests/xmlrpc_test.info
index eadcd28a..28567942 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/statistics/statistics.admin.inc b/drupal7/modules/statistics/statistics.admin.inc
index 71e64aa5..e83a115f 100644
--- a/drupal7/modules/statistics/statistics.admin.inc
+++ b/drupal7/modules/statistics/statistics.admin.inc
@@ -137,7 +137,8 @@ function statistics_top_visitors() {
     ->groupBy('u.name')
     ->groupBy('bl.iid')
     ->limit(30)
-    ->orderByHeader($header);
+    ->orderByHeader($header)
+    ->orderBy('a.hostname');
 
   $uniques_query = db_select('accesslog')->distinct();
   $uniques_query->fields('accesslog', array('uid', 'hostname'));
diff --git a/drupal7/modules/statistics/statistics.info b/drupal7/modules/statistics/statistics.info
index 83101583..8bf97ff4 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/syslog/syslog.info b/drupal7/modules/syslog/syslog.info
index feb8a668..8c11c5e9 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/system/system.admin.inc b/drupal7/modules/system/system.admin.inc
index b6f67890..22c202c3 100644
--- a/drupal7/modules/system/system.admin.inc
+++ b/drupal7/modules/system/system.admin.inc
@@ -640,13 +640,13 @@ function system_theme_settings_validate($form, &$form_state) {
 
   // If the user provided a path for a logo or favicon file, make sure a file
   // exists at that path.
-  if ($form_state['values']['logo_path']) {
+  if (!empty($form_state['values']['logo_path'])) {
     $path = _system_theme_settings_validate_path($form_state['values']['logo_path']);
     if (!$path) {
       form_set_error('logo_path', t('The custom logo path is invalid.'));
     }
   }
-  if ($form_state['values']['favicon_path']) {
+  if (!empty($form_state['values']['favicon_path'])) {
     $path = _system_theme_settings_validate_path($form_state['values']['favicon_path']);
     if (!$path) {
       form_set_error('favicon_path', t('The custom favicon path is invalid.'));
@@ -703,14 +703,16 @@ function system_theme_settings_submit($form, &$form_state) {
 
   // If the user uploaded a new logo or favicon, save it to a permanent location
   // and use it in place of the default theme-provided file.
-  if ($file = $values['logo_upload']) {
+  if (!empty($values['logo_upload'])) {
+    $file = $values['logo_upload'];
     unset($values['logo_upload']);
     $filename = file_unmanaged_copy($file->uri);
     $values['default_logo'] = 0;
     $values['logo_path'] = $filename;
     $values['toggle_logo'] = 1;
   }
-  if ($file = $values['favicon_upload']) {
+  if (!empty($values['favicon_upload'])) {
+    $file = $values['favicon_upload'];
     unset($values['favicon_upload']);
     $filename = file_unmanaged_copy($file->uri);
     $values['default_favicon'] = 0;
diff --git a/drupal7/modules/system/system.api.php b/drupal7/modules/system/system.api.php
index 22175b13..b60f50de 100644
--- a/drupal7/modules/system/system.api.php
+++ b/drupal7/modules/system/system.api.php
@@ -247,7 +247,7 @@ function hook_entity_info() {
         'custom settings' => FALSE,
       ),
       'search_result' => array(
-        'label' => t('Search result'),
+        'label' => t('Search result highlighting input'),
         'custom settings' => FALSE,
       ),
     );
diff --git a/drupal7/modules/system/system.base-rtl.css b/drupal7/modules/system/system.base-rtl.css
index 075cafec..79d6302d 100644
--- a/drupal7/modules/system/system.base-rtl.css
+++ b/drupal7/modules/system/system.base-rtl.css
@@ -9,10 +9,10 @@
  */
 /* Animated throbber */
 html.js input.form-autocomplete {
-  background-position: 0% 2px;
+  background-position: 0% center;
 }
 html.js input.throbbing {
-  background-position: 0% -18px;
+  background-position: 0% center;
 }
 
 /**
diff --git a/drupal7/modules/system/system.base.css b/drupal7/modules/system/system.base.css
index 412b18a8..7e9220da 100644
--- a/drupal7/modules/system/system.base.css
+++ b/drupal7/modules/system/system.base.css
@@ -31,12 +31,13 @@
 }
 /* Animated throbber */
 html.js input.form-autocomplete {
-  background-image: url(../../misc/throbber.gif);
-  background-position: 100% 2px; /* LTR */
+  background-image: url(../../misc/throbber-inactive.png);
+  background-position: 100% center; /* LTR */
   background-repeat: no-repeat;
 }
 html.js input.throbbing {
-  background-position: 100% -18px; /* LTR */
+  background-image: url(../../misc/throbber-active.gif);
+  background-position: 100% center; /* LTR */
 }
 
 /**
@@ -164,7 +165,7 @@ table.sticky-header {
   display: inline-block;
 }
 .ajax-progress .throbber {
-  background: transparent url(../../misc/throbber.gif) no-repeat 0px -18px;
+  background: transparent url(../../misc/throbber-active.gif) no-repeat 0px center;
   float: left; /* LTR */
   height: 15px;
   margin: 2px;
diff --git a/drupal7/modules/system/system.info b/drupal7/modules/system/system.info
index aff552e1..f0b92a5d 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/system/system.module b/drupal7/modules/system/system.module
index 18d8a887..a2749357 100644
--- a/drupal7/modules/system/system.module
+++ b/drupal7/modules/system/system.module
@@ -2399,6 +2399,10 @@ function _system_rebuild_module_data() {
       continue;
     }
 
+    // Add the info file modification time, so it becomes available for
+    // contributed modules to use for ordering module lists.
+    $module->info['mtime'] = filemtime(dirname($module->uri) . '/' . $module->name . '.info');
+
     // Merge in defaults and save.
     $modules[$key]->info = $module->info + $defaults;
 
@@ -2537,6 +2541,10 @@ function _system_rebuild_theme_data() {
     $themes[$key]->filename = $theme->uri;
     $themes[$key]->info = drupal_parse_info_file($theme->uri) + $defaults;
 
+    // Add the info file modification time, so it becomes available for
+    // contributed modules to use for ordering theme lists.
+    $themes[$key]->info['mtime'] = filemtime($theme->uri);
+
     // Invoke hook_system_info_alter() to give installed modules a chance to
     // modify the data in the .info files if necessary.
     $type = 'theme';
@@ -3386,7 +3394,7 @@ function system_timezone($abbreviation = '', $offset = -1, $is_daylight_saving_t
  * @ingroup themeable
  */
 function theme_system_powered_by() {
-  return '<span>' . t('Powered by <a href="@poweredby">Drupal</a>', array('@poweredby' => 'http://drupal.org')) . '</span>';
+  return '<span>' . t('Powered by <a href="@poweredby">Drupal</a>', array('@poweredby' => 'https://www.drupal.org')) . '</span>';
 }
 
 /**
diff --git a/drupal7/modules/system/system.test b/drupal7/modules/system/system.test
index cae5cc78..aefbfbc4 100644
--- a/drupal7/modules/system/system.test
+++ b/drupal7/modules/system/system.test
@@ -556,6 +556,34 @@ class ModuleDependencyTestCase extends ModuleTestCase {
     $this->drupalPost(NULL, NULL, t('Uninstall'));
     $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.');
   }
+
+  /**
+   * Tests whether the correct module metadata is returned.
+   */
+  function testModuleMetaData() {
+    // Generate the list of available modules.
+    $modules = system_rebuild_module_data();
+    // Check that the mtime field exists for the system module.
+    $this->assertTrue(!empty($modules['system']->info['mtime']), 'The system.info file modification time field is present.');
+    // Use 0 if mtime isn't present, to avoid an array index notice.
+    $test_mtime = !empty($modules['system']->info['mtime']) ? $modules['system']->info['mtime'] : 0;
+    // Ensure the mtime field contains a number that is greater than zero.
+    $this->assertTrue(is_numeric($test_mtime) && ($test_mtime > 0), 'The system.info file modification time field contains a timestamp.');
+  }
+
+  /**
+   * Tests whether the correct theme metadata is returned.
+   */
+  function testThemeMetaData() {
+    // Generate the list of available themes.
+    $themes = system_rebuild_theme_data();
+    // Check that the mtime field exists for the bartik theme.
+    $this->assertTrue(!empty($themes['bartik']->info['mtime']), 'The bartik.info file modification time field is present.');
+    // Use 0 if mtime isn't present, to avoid an array index notice.
+    $test_mtime = !empty($themes['bartik']->info['mtime']) ? $themes['bartik']->info['mtime'] : 0;
+    // Ensure the mtime field contains a number that is greater than zero.
+    $this->assertTrue(is_numeric($test_mtime) && ($test_mtime > 0), 'The bartik.info file modification time field contains a timestamp.');
+  }
 }
 
 /**
diff --git a/drupal7/modules/system/tests/cron_queue_test.info b/drupal7/modules/system/tests/cron_queue_test.info
index 43cd6293..4fd1bd8b 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/taxonomy/taxonomy.info b/drupal7/modules/taxonomy/taxonomy.info
index 13ddbc0d..00948dd0 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/taxonomy/taxonomy.module b/drupal7/modules/taxonomy/taxonomy.module
index 4191146a..e147c1ca 100644
--- a/drupal7/modules/taxonomy/taxonomy.module
+++ b/drupal7/modules/taxonomy/taxonomy.module
@@ -776,15 +776,26 @@ function taxonomy_term_show($term) {
  *   An array in the format expected by drupal_render().
  */
 function taxonomy_term_view_multiple($terms, $view_mode = 'teaser', $weight = 0, $langcode = NULL) {
-  field_attach_prepare_view('taxonomy_term', $terms, $view_mode, $langcode);
-  entity_prepare_view('taxonomy_term', $terms, $langcode);
   $build = array();
+  $entities_by_view_mode = entity_view_mode_prepare('taxonomy_term', $terms, $view_mode, $langcode);
+  foreach ($entities_by_view_mode as $entity_view_mode => $entities) {
+    field_attach_prepare_view('taxonomy_term', $entities, $entity_view_mode, $langcode);
+    entity_prepare_view('taxonomy_term', $entities, $langcode);
+
+    foreach ($entities as $entity) {
+      $build['taxonomy_terms'][$entity->tid] = taxonomy_term_view($entity, $entity_view_mode, $langcode);
+    }
+  }
+
   foreach ($terms as $term) {
-    $build['taxonomy_terms'][$term->tid] = taxonomy_term_view($term, $view_mode, $langcode);
     $build['taxonomy_terms'][$term->tid]['#weight'] = $weight;
     $weight++;
   }
+  // Sort here, to preserve the input order of the entities that were passed to
+  // this function.
+  uasort($build['taxonomy_terms'], 'element_sort');
   $build['taxonomy_terms']['#sorted'] = TRUE;
+
   return $build;
 }
 
@@ -817,12 +828,7 @@ function taxonomy_term_build_content($term, $view_mode = 'full', $langcode = NUL
   $term->content = array();
 
   // Allow modules to change the view mode.
-  $context = array(
-    'entity_type' => 'taxonomy_term',
-    'entity' => $term,
-    'langcode' => $langcode,
-  );
-  drupal_alter('entity_view_mode', $view_mode, $context);
+  $view_mode = key(entity_view_mode_prepare('taxonomy_term', array($term->tid => $term), $view_mode, $langcode));
 
   // Add the term description if the term has one and it is visible.
   $type = 'taxonomy_term';
diff --git a/drupal7/modules/toolbar/toolbar.info b/drupal7/modules/toolbar/toolbar.info
index 1e341b4b..48adb661 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/tracker/tracker.info b/drupal7/modules/tracker/tracker.info
index 2c5eff51..5a5b5390 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/tracker/tracker.module b/drupal7/modules/tracker/tracker.module
index 8694222d..ab3e7485 100644
--- a/drupal7/modules/tracker/tracker.module
+++ b/drupal7/modules/tracker/tracker.module
@@ -263,7 +263,7 @@ function _tracker_add($nid, $uid, $changed) {
     ))
     ->execute();
 
-  // Create or update the user-level data.
+  // Create or update the user-level data, first for the user posting.
   db_merge('tracker_user')
     ->key(array(
       'nid' => $nid,
@@ -274,6 +274,14 @@ function _tracker_add($nid, $uid, $changed) {
       'published' => $node->status,
     ))
     ->execute();
+  // Update the times for all the other users tracking the post.
+  db_update('tracker_user')
+    ->condition('nid', $nid)
+    ->fields(array(
+      'changed' => $changed,
+      'published' => $node->status,
+    ))
+    ->execute();
 }
 
 /**
diff --git a/drupal7/modules/tracker/tracker.test b/drupal7/modules/tracker/tracker.test
index 66ebb848..8a48ea81 100644
--- a/drupal7/modules/tracker/tracker.test
+++ b/drupal7/modules/tracker/tracker.test
@@ -182,6 +182,72 @@ class TrackerTest extends DrupalWebTestCase {
     $this->assertText('1 new', 'New comments are counted on the tracker listing pages.');
   }
 
+  /**
+   * Tests for ordering on a users tracker listing when comments are posted.
+   */
+  function testTrackerOrderingNewComments() {
+    $this->drupalLogin($this->user);
+
+    $node_one = $this->drupalCreateNode(array(
+      'title' => $this->randomName(8),
+    ));
+
+    $node_two = $this->drupalCreateNode(array(
+      'title' => $this->randomName(8),
+    ));
+
+    // Now get other_user to track these pieces of content.
+    $this->drupalLogin($this->other_user);
+
+    // Add a comment to the first page.
+    $comment = array(
+      'subject' => $this->randomName(),
+      'comment_body[' . LANGUAGE_NONE . '][0][value]' => $this->randomName(20),
+    );
+    $this->drupalPost('comment/reply/' . $node_one->nid, $comment, t('Save'));
+
+    // If the comment is posted in the same second as the last one then Drupal
+    // can't tell the difference, so we wait one second here.
+    sleep(1);
+
+    // Add a comment to the second page.
+    $comment = array(
+      'subject' => $this->randomName(),
+      'comment_body[' . LANGUAGE_NONE . '][0][value]' => $this->randomName(20),
+    );
+    $this->drupalPost('comment/reply/' . $node_two->nid, $comment, t('Save'));
+
+    // We should at this point have in our tracker for other_user:
+    // 1. node_two
+    // 2. node_one
+    // Because that's the reverse order of the posted comments.
+
+    // Now we're going to post a comment to node_one which should jump it to the
+    // top of the list.
+
+    $this->drupalLogin($this->user);
+    // If the comment is posted in the same second as the last one then Drupal
+    // can't tell the difference, so we wait one second here.
+    sleep(1);
+
+    // Add a comment to the second page.
+    $comment = array(
+      'subject' => $this->randomName(),
+      'comment_body[' . LANGUAGE_NONE . '][0][value]' => $this->randomName(20),
+    );
+    $this->drupalPost('comment/reply/' . $node_one->nid, $comment, t('Save'));
+
+    // Switch back to the other_user and assert that the order has swapped.
+    $this->drupalLogin($this->other_user);
+    $this->drupalGet('user/' . $this->other_user->uid . '/track');
+    // This is a cheeky way of asserting that the nodes are in the right order
+    // on the tracker page.
+    // It's almost certainly too brittle.
+    $pattern = '/' . preg_quote($node_one->title) . '.+' . preg_quote($node_two->title) . '/s';
+    $this->verbose($pattern);
+    $this->assertPattern($pattern, 'Most recently commented on node appears at the top of tracker');
+  }
+
   /**
    * Tests that existing nodes are indexed by cron.
    */
diff --git a/drupal7/modules/translation/tests/translation_test.info b/drupal7/modules/translation/tests/translation_test.info
index 2123d56d..921bcf61 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/translation/translation.info b/drupal7/modules/translation/translation.info
index e532090a..f5521f72 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/translation/translation.module b/drupal7/modules/translation/translation.module
index 33123570..53c4641e 100644
--- a/drupal7/modules/translation/translation.module
+++ b/drupal7/modules/translation/translation.module
@@ -336,9 +336,13 @@ function translation_node_insert($node) {
             'tnid' => $tnid,
             'translate' => 0,
           ))
-          ->condition('nid', $node->translation_source->nid)
+          ->condition('nid', $tnid)
           ->execute();
+
+        // Flush the (untranslated) source node from the load cache.
+        entity_get_controller('node')->resetCache(array($tnid));
       }
+
       db_update('node')
         ->fields(array(
           'tnid' => $tnid,
@@ -368,13 +372,23 @@ function translation_node_update($node) {
         ))
         ->condition('nid', $node->nid)
         ->execute();
+
       if (!empty($node->translation['retranslate'])) {
         // This is the source node, asking to mark all translations outdated.
-        db_update('node')
-          ->fields(array('translate' => 1))
+        $translations = db_select('node', 'n')
+          ->fields('n', array('nid'))
           ->condition('nid', $node->nid, '<>')
           ->condition('tnid', $node->tnid)
+          ->execute()
+          ->fetchCol();
+
+        db_update('node')
+          ->fields(array('translate' => 1))
+          ->condition('nid', $translations, 'IN')
           ->execute();
+
+        // Flush the modified translation nodes from the load cache.
+        entity_get_controller('node')->resetCache($translations);
       }
     }
   }
@@ -420,11 +434,16 @@ function translation_remove_from_set($node) {
         'tnid' => 0,
         'translate' => 0,
       ));
-    if (db_query('SELECT COUNT(*) FROM {node} WHERE tnid = :tnid', array(':tnid' => $node->tnid))->fetchField() == 1) {
+
+    // Determine which nodes to apply the update to.
+    $set_nids = db_query('SELECT nid FROM {node} WHERE tnid = :tnid', array(':tnid' => $node->tnid))->fetchCol();
+    if (count($set_nids) == 1) {
       // There is only one node left in the set: remove the set altogether.
       $query
         ->condition('tnid', $node->tnid)
         ->execute();
+
+      $flush_set = TRUE;
     }
     else {
       $query
@@ -439,8 +458,14 @@ function translation_remove_from_set($node) {
           ->fields(array('tnid' => $new_tnid))
           ->condition('tnid', $node->tnid)
           ->execute();
+
+        $flush_set = TRUE;
       }
     }
+
+    // Flush the modified nodes from the load cache.
+    $nids = !empty($flush_set) ? $set_nids : array($node->nid);
+    entity_get_controller('node')->resetCache($nids);
   }
 }
 
diff --git a/drupal7/modules/trigger/tests/trigger_test.info b/drupal7/modules/trigger/tests/trigger_test.info
index 250c78f1..93b41349 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/trigger/trigger.info b/drupal7/modules/trigger/trigger.info
index 2a5f54c7..e717ee09 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/update/tests/aaa_update_test.info b/drupal7/modules/update/tests/aaa_update_test.info
index ac17038a..a016f415 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/update/tests/bbb_update_test.info b/drupal7/modules/update/tests/bbb_update_test.info
index 9730b8d6..47ab5b5b 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/update/tests/ccc_update_test.info b/drupal7/modules/update/tests/ccc_update_test.info
index 77bacd15..ee64603b 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 3325a325..b47dd4cc 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 19e5c895..9f8ea0e8 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/update/tests/update_test.info b/drupal7/modules/update/tests/update_test.info
index 574e82c7..d53cc3cc 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/update/update.compare.inc b/drupal7/modules/update/update.compare.inc
index 6e0c5fee..072a0daa 100644
--- a/drupal7/modules/update/update.compare.inc
+++ b/drupal7/modules/update/update.compare.inc
@@ -417,14 +417,15 @@ function update_calculate_project_data($available) {
  * version (e.g., 5.x-1.5-beta1, 5.x-1.5-beta2, and 5.x-1.5). Development
  * snapshots for a given major version are always listed last.
  *
- * @param $project
- *   An array containing information about a specific project.
+ * @param $unused
+ *   Input is not being used, but remains in function for API compatibility
+ *   reasons.
  * @param $project_data
  *   An array containing information about a specific project.
  * @param $available
  *   Data about available project releases of a specific project.
  */
-function update_calculate_project_update_status($project, &$project_data, $available) {
+function update_calculate_project_update_status($unused, &$project_data, $available) {
   foreach (array('title', 'link') as $attribute) {
     if (!isset($project_data[$attribute]) && isset($available[$attribute])) {
       $project_data[$attribute] = $available[$attribute];
diff --git a/drupal7/modules/update/update.info b/drupal7/modules/update/update.info
index 1f00015d..20c3b0e3 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/user/tests/user_form_test.info b/drupal7/modules/user/tests/user_form_test.info
index 07049d34..f0ea4a6b 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/user/user.api.php b/drupal7/modules/user/user.api.php
index 3afc88ab..e88c7a97 100644
--- a/drupal7/modules/user/user.api.php
+++ b/drupal7/modules/user/user.api.php
@@ -386,7 +386,7 @@ function hook_user_view_alter(&$build) {
 }
 
 /**
- * Inform other modules that a user role is about to be saved.
+ * Act on a user role being inserted or updated.
  *
  * Modules implementing this hook can act on the user role object before
  * it has been saved to the database.
@@ -405,7 +405,7 @@ function hook_user_role_presave($role) {
 }
 
 /**
- * Inform other modules that a user role has been added.
+ * Respond to creation of a new user role.
  *
  * Modules implementing this hook can act on the user role object when saved to
  * the database. It's recommended that you implement this hook if your module
@@ -426,7 +426,7 @@ function hook_user_role_insert($role) {
 }
 
 /**
- * Inform other modules that a user role has been updated.
+ * Respond to updates to a user role.
  *
  * Modules implementing this hook can act on the user role object when updated.
  * It's recommended that you implement this hook if your module adds additional
@@ -447,7 +447,7 @@ function hook_user_role_update($role) {
 }
 
 /**
- * Inform other modules that a user role has been deleted.
+ * Respond to user role deletion.
  *
  * This hook allows you act when a user role has been deleted.
  * If your module stores references to roles, it's recommended that you
diff --git a/drupal7/modules/user/user.info b/drupal7/modules/user/user.info
index 3f72643e..0d65345c 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/modules/user/user.module b/drupal7/modules/user/user.module
index b2397993..60f32a15 100644
--- a/drupal7/modules/user/user.module
+++ b/drupal7/modules/user/user.module
@@ -501,12 +501,17 @@ function user_save($account, $edit = array(), $category = 'account') {
         file_usage_delete($account->original->picture, 'user', 'user', $account->uid);
         file_delete($account->original->picture);
       }
+      // Save the picture object, if it is set. drupal_write_record() expects
+      // $account->picture to be a FID.
+      $picture = empty($account->picture) ? NULL : $account->picture;
       $account->picture = empty($account->picture->fid) ? 0 : $account->picture->fid;
 
       // Do not allow 'uid' to be changed.
       $account->uid = $account->original->uid;
       // Save changes to the user table.
       $success = drupal_write_record('users', $account, 'uid');
+      // Restore the picture object.
+      $account->picture = $picture;
       if ($success === FALSE) {
         // The query failed - better to abort the save than risk further
         // data loss.
@@ -589,16 +594,16 @@ function user_save($account, $edit = array(), $category = 'account') {
       user_module_invoke('insert', $edit, $account, $category);
       module_invoke_all('entity_insert', $account, 'user');
 
-      // Save user roles.
-      if (count($account->roles) > 1) {
+      // Save user roles. Skip built-in roles, and ones that were already saved
+      // to the database during hook calls.
+      $rids_to_skip = array_merge(array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID), db_query('SELECT rid FROM {users_roles} WHERE uid = :uid', array(':uid' => $account->uid))->fetchCol());
+      if ($rids_to_save = array_diff(array_keys($account->roles), $rids_to_skip)) {
         $query = db_insert('users_roles')->fields(array('uid', 'rid'));
-        foreach (array_keys($account->roles) as $rid) {
-          if (!in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) {
-            $query->values(array(
-              'uid' => $account->uid,
-              'rid' => $rid,
-            ));
-          }
+        foreach ($rids_to_save as $rid) {
+          $query->values(array(
+            'uid' => $account->uid,
+            'rid' => $rid,
+          ));
         }
         $query->execute();
       }
@@ -2633,12 +2638,7 @@ function user_build_content($account, $view_mode = 'full', $langcode = NULL) {
   $account->content = array();
 
   // Allow modules to change the view mode.
-  $context = array(
-    'entity_type' => 'user',
-    'entity' => $account,
-    'langcode' => $langcode,
-  );
-  drupal_alter('entity_view_mode', $view_mode, $context);
+  $view_mode = key(entity_view_mode_prepare('user', array($account->uid => $account), $view_mode, $langcode));
 
   // Build fields content.
   field_attach_prepare_view('user', array($account->uid => $account), $view_mode, $langcode);
@@ -3773,8 +3773,8 @@ function user_register_form($form, &$form_state) {
   // inside the submit function interferes with form processing and breaks
   // hook_form_alter().
   $form['administer_users'] = array(
-     '#type' => 'value',
-     '#value' => $admin,
+    '#type' => 'value',
+    '#value' => $admin,
   );
 
   // If we aren't admin but already logged on, go to the user page instead.
diff --git a/drupal7/modules/user/user.test b/drupal7/modules/user/user.test
index e2086d4f..03f0bbcd 100644
--- a/drupal7/modules/user/user.test
+++ b/drupal7/modules/user/user.test
@@ -1127,6 +1127,17 @@ class UserPictureTestCase extends DrupalWebTestCase {
 
       $pic_path2 = $this->saveUserPicture($image);
       $this->assertNotEqual($pic_path, $pic_path2, 'Filename of second picture is different.');
+
+      // Check if user picture has a valid file ID after saving the user.
+      $account = user_load($this->user->uid, TRUE);
+      $this->assertTrue(is_object($account->picture), 'User picture object is valid after user load.');
+      $this->assertNotNull($account->picture->fid, 'User picture object has a FID after user load.');
+      $this->assertTrue(is_file($account->picture->uri), 'File is located in proper directory after user load.');
+      user_save($account);
+      // Verify that the user save does not destroy the user picture object.
+      $this->assertTrue(is_object($account->picture), 'User picture object is valid after user save.');
+      $this->assertNotNull($account->picture->fid, 'User picture object has a FID after user save.');
+      $this->assertTrue(is_file($account->picture->uri), 'File is located in proper directory after user save.');
     }
   }
 
diff --git a/drupal7/profiles/minimal/minimal.info b/drupal7/profiles/minimal/minimal.info
index 8125179d..965e69fa 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/profiles/standard/standard.info b/drupal7/profiles/standard/standard.info
index feb02b34..d2d2f12f 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 39a15549..1d3ec366 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
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 10492ce0..8168bad9 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/profiles/testing/testing.info b/drupal7/profiles/testing/testing.info
index 1b5b5b89..3789ce41 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/scripts/run-tests.sh b/drupal7/scripts/run-tests.sh
index 189d7f2e..9078168a 100644
--- a/drupal7/scripts/run-tests.sh
+++ b/drupal7/scripts/run-tests.sh
@@ -419,9 +419,20 @@ function simpletest_script_get_test_list() {
   else {
     if ($args['class']) {
       // Check for valid class names.
-      foreach ($args['test_names'] as $class_name) {
-        if (in_array($class_name, $all_tests)) {
-          $test_list[] = $class_name;
+      $test_list = array();
+      foreach ($args['test_names'] as $test_class) {
+        if (class_exists($test_class)) {
+          $test_list[] = $test_class;
+        }
+        else {
+          $groups = simpletest_test_get_all();
+          $all_classes = array();
+          foreach ($groups as $group) {
+            $all_classes = array_merge($all_classes, array_keys($group));
+          }
+          simpletest_script_print_error('Test class not found: ' . $test_class);
+          simpletest_script_print_alternatives($test_class, $all_classes, 6);
+          exit(1);
         }
       }
     }
@@ -444,9 +455,12 @@ function simpletest_script_get_test_list() {
       // Check for valid group names and get all valid classes in group.
       foreach ($args['test_names'] as $group_name) {
         if (isset($groups[$group_name])) {
-          foreach ($groups[$group_name] as $class_name => $info) {
-            $test_list[] = $class_name;
-          }
+          $test_list = array_merge($test_list, array_keys($groups[$group_name]));
+        }
+        else {
+          simpletest_script_print_error('Test group not found: ' . $group_name);
+          simpletest_script_print_alternatives($group_name, array_keys($groups));
+          exit(1);
         }
       }
     }
@@ -674,3 +688,37 @@ function simpletest_script_color_code($status) {
   }
   return 0; // Default formatting.
 }
+
+/**
+ * Prints alternative test names.
+ *
+ * Searches the provided array of string values for close matches based on the
+ * Levenshtein algorithm.
+ *
+ * @see http://php.net/manual/en/function.levenshtein.php
+ *
+ * @param string $string
+ *   A string to test.
+ * @param array $array
+ *   A list of strings to search.
+ * @param int $degree
+ *   The matching strictness. Higher values return fewer matches. A value of
+ *   4 means that the function will return strings from $array if the candidate
+ *   string in $array would be identical to $string by changing 1/4 or fewer of
+ *   its characters.
+ */
+function simpletest_script_print_alternatives($string, $array, $degree = 4) {
+  $alternatives = array();
+  foreach ($array as $item) {
+    $lev = levenshtein($string, $item);
+    if ($lev <= strlen($item) / $degree || FALSE !== strpos($string, $item)) {
+      $alternatives[] = $item;
+    }
+  }
+  if (!empty($alternatives)) {
+    simpletest_script_print("  Did you mean?\n", SIMPLETEST_SCRIPT_COLOR_FAIL);
+    foreach ($alternatives as $alternative) {
+      simpletest_script_print("  - $alternative\n", SIMPLETEST_SCRIPT_COLOR_FAIL);
+    }
+  }
+}
diff --git a/drupal7/themes/bartik/bartik.info b/drupal7/themes/bartik/bartik.info
index c394ebda..707072b9 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/themes/bartik/css/style-rtl.css b/drupal7/themes/bartik/css/style-rtl.css
index 3bb02ca2..991edfc4 100644
--- a/drupal7/themes/bartik/css/style-rtl.css
+++ b/drupal7/themes/bartik/css/style-rtl.css
@@ -225,10 +225,10 @@ ul.action-links li a {
 
 /* Animated throbber */
 html.js input.form-autocomplete {
-  background-position: 1% 4px;
+  background-position: 1% center;
 }
 html.js input.throbbing {
-  background-position: 1% -16px;
+  background-position: 1% center;
 }
 
 /* Comment form */
diff --git a/drupal7/themes/bartik/css/style.css b/drupal7/themes/bartik/css/style.css
index c40755b1..8426e56c 100644
--- a/drupal7/themes/bartik/css/style.css
+++ b/drupal7/themes/bartik/css/style.css
@@ -704,7 +704,6 @@ ul.links {
 }
 .comment .submitted .comment-permalink {
   font-size: 0.786em;
-  text-transform: lowercase;
 }
 .comment .content {
   font-size: 0.929em;
@@ -1326,14 +1325,6 @@ input.form-button-disabled:active,
   color: #717171;
 }
 
-/* Animated throbber */
-html.js input.form-autocomplete {
-  background-position: 100% 4px; /* LTR */
-}
-html.js input.throbbing {
-  background-position: 100% -16px; /* LTR */
-}
-
 /* Comment form */
 .comment-form label {
   float: left; /* LTR */
diff --git a/drupal7/themes/garland/garland.info b/drupal7/themes/garland/garland.info
index 42533b47..a991280c 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/themes/seven/seven.info b/drupal7/themes/seven/seven.info
index a0db6506..f3098b43 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
diff --git a/drupal7/themes/seven/style.css b/drupal7/themes/seven/style.css
index 56a6094f..c52d661d 100644
--- a/drupal7/themes/seven/style.css
+++ b/drupal7/themes/seven/style.css
@@ -709,12 +709,7 @@ select.form-select:focus {
   color: #000;
   border-color: #ace;
 }
-html.js input.form-autocomplete {
-  background-position: 100% 4px;
-}
-html.js input.throbbing {
-  background-position: 100% -16px;
-}
+
 ul.action-links {
   margin: 1em 0;
   padding: 0 20px 0 20px; /* LTR */
diff --git a/drupal7/themes/stark/stark.info b/drupal7/themes/stark/stark.info
index f762e44c..a2956da7 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 2014-10-15
-version = "7.32"
+; Information added by Drupal.org packaging script on 2014-11-07
+version = "7.33"
 project = "drupal"
-datestamp = "1413387510"
+datestamp = "1415375131"
 
