Browse Source

updated core to 7.54

Bachir Soussi Chiadmi 6 years ago
parent
commit
728f8e6d31
100 changed files with 656 additions and 270 deletions
  1. 19 0
      CHANGELOG.txt
  2. 12 2
      includes/bootstrap.inc
  3. 12 2
      includes/cache.inc
  4. 9 2
      includes/common.inc
  5. 10 10
      includes/date.inc
  6. 2 2
      includes/form.inc
  7. 2 1
      includes/menu.inc
  8. 150 2
      includes/stream_wrappers.inc
  9. 3 3
      modules/aggregator/aggregator.info
  10. 3 3
      modules/aggregator/tests/aggregator_test.info
  11. 3 3
      modules/block/block.info
  12. 3 3
      modules/block/tests/block_test.info
  13. 3 3
      modules/block/tests/themes/block_test_theme/block_test_theme.info
  14. 3 3
      modules/blog/blog.info
  15. 3 3
      modules/book/book.info
  16. 3 3
      modules/color/color.info
  17. 1 1
      modules/color/color.test
  18. 3 3
      modules/comment/comment.info
  19. 8 2
      modules/comment/comment.test
  20. 3 3
      modules/contact/contact.info
  21. 3 3
      modules/contextual/contextual.info
  22. 3 3
      modules/dashboard/dashboard.info
  23. 1 1
      modules/dblog/dblog.admin.inc
  24. 3 3
      modules/dblog/dblog.info
  25. 3 3
      modules/field/field.info
  26. 3 3
      modules/field/modules/field_sql_storage/field_sql_storage.info
  27. 3 3
      modules/field/modules/list/list.info
  28. 3 3
      modules/field/modules/list/tests/list_test.info
  29. 3 3
      modules/field/modules/number/number.info
  30. 9 0
      modules/field/modules/number/number.module
  31. 46 0
      modules/field/modules/number/number.test
  32. 3 3
      modules/field/modules/options/options.info
  33. 22 6
      modules/field/modules/options/options.test
  34. 3 3
      modules/field/modules/text/text.info
  35. 3 3
      modules/field/tests/field_test.info
  36. 3 3
      modules/field_ui/field_ui.info
  37. 3 3
      modules/file/file.info
  38. 2 1
      modules/file/file.module
  39. 50 0
      modules/file/tests/file.test
  40. 3 3
      modules/file/tests/file_module_test.info
  41. 3 3
      modules/filter/filter.info
  42. 1 1
      modules/filter/filter.module
  43. 3 3
      modules/forum/forum.info
  44. 3 3
      modules/help/help.info
  45. 3 3
      modules/image/image.info
  46. 3 3
      modules/image/tests/image_module_test.info
  47. 3 3
      modules/locale/locale.info
  48. 3 3
      modules/locale/tests/locale_test.info
  49. 3 3
      modules/menu/menu.info
  50. 3 3
      modules/node/node.info
  51. 3 3
      modules/node/tests/node_access_test.info
  52. 3 3
      modules/node/tests/node_test.info
  53. 3 3
      modules/node/tests/node_test_exception.info
  54. 3 3
      modules/openid/openid.info
  55. 3 3
      modules/openid/tests/openid_test.info
  56. 3 3
      modules/overlay/overlay.info
  57. 3 3
      modules/path/path.info
  58. 3 3
      modules/php/php.info
  59. 3 3
      modules/poll/poll.info
  60. 3 3
      modules/profile/profile.info
  61. 3 3
      modules/rdf/rdf.info
  62. 3 3
      modules/rdf/tests/rdf_test.info
  63. 10 0
      modules/search/search.admin.inc
  64. 3 3
      modules/search/search.info
  65. 1 0
      modules/search/search.install
  66. 4 3
      modules/search/search.pages.inc
  67. 14 1
      modules/search/search.test
  68. 3 3
      modules/search/tests/search_embedded_form.info
  69. 3 3
      modules/search/tests/search_extra_type.info
  70. 3 3
      modules/search/tests/search_node_tags.info
  71. 3 3
      modules/shortcut/shortcut.info
  72. 7 5
      modules/simpletest/drupal_web_test_case.php
  73. 3 3
      modules/simpletest/simpletest.info
  74. 3 3
      modules/simpletest/tests/actions_loop_test.info
  75. 3 3
      modules/simpletest/tests/ajax_forms_test.info
  76. 3 3
      modules/simpletest/tests/ajax_test.info
  77. 3 3
      modules/simpletest/tests/batch_test.info
  78. 3 3
      modules/simpletest/tests/boot_test_1.info
  79. 3 3
      modules/simpletest/tests/boot_test_2.info
  80. 3 3
      modules/simpletest/tests/common_test.info
  81. 3 3
      modules/simpletest/tests/common_test_cron_helper.info
  82. 3 3
      modules/simpletest/tests/database_test.info
  83. 3 3
      modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.info
  84. 3 3
      modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
  85. 3 3
      modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
  86. 3 3
      modules/simpletest/tests/entity_cache_test.info
  87. 3 3
      modules/simpletest/tests/entity_cache_test_dependency.info
  88. 3 3
      modules/simpletest/tests/entity_crud_hook_test.info
  89. 3 3
      modules/simpletest/tests/entity_query_access_test.info
  90. 3 3
      modules/simpletest/tests/error_test.info
  91. 3 3
      modules/simpletest/tests/file_test.info
  92. 3 3
      modules/simpletest/tests/filter_test.info
  93. 8 0
      modules/simpletest/tests/form.test
  94. 3 3
      modules/simpletest/tests/form_test.info
  95. 28 0
      modules/simpletest/tests/form_test.module
  96. 3 3
      modules/simpletest/tests/image_test.info
  97. 3 3
      modules/simpletest/tests/menu_test.info
  98. 3 3
      modules/simpletest/tests/module_test.info
  99. 3 3
      modules/simpletest/tests/path_test.info
  100. 3 3
      modules/simpletest/tests/psr_0_test/psr_0_test.info

+ 19 - 0
CHANGELOG.txt

@@ -1,4 +1,23 @@
 
+Drupal 7.54, 2017-02-01
+-----------------------
+- Modules are now able to define theme engines (API addition:
+  https://www.drupal.org/node/2826480).
+- Logging of searches can now be disabled (new option in the administrative
+  interface).
+- Added menu tree render structure to (pre-)process hooks for theme_menu_tree()
+  (API addition: https://www.drupal.org/node/2827134).
+- Added new function for determining whether an HTTPS request is being served
+  (API addition: https://www.drupal.org/node/2824590).
+- Fixed incorrect default value for short and medium date formats on the date
+  type configuration page.
+- File validation error message is now removed after subsequent upload of valid
+  file.
+- Numerous bug fixes.
+- Numerous API documentation improvements.
+- Additional performance improvements.
+- Additional automated test coverage.
+
 Drupal 7.53, 2016-12-07
 -----------------------
 - Fixed drag and drop support on newer Chrome/IE 11+ versions after 7.51 update

+ 12 - 2
includes/bootstrap.inc

@@ -8,7 +8,7 @@
 /**
  * The current system version.
  */
-define('VERSION', '7.53');
+define('VERSION', '7.54');
 
 /**
  * Core API compatibility.
@@ -718,6 +718,16 @@ function drupal_valid_http_host($host) {
     && preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host);
 }
 
+/**
+ * Checks whether an HTTPS request is being served.
+ *
+ * @return bool
+ *   TRUE if the request is HTTPS, FALSE otherwise.
+ */
+function drupal_is_https() {
+  return isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
+}
+
 /**
  * Sets the base URL, cookie domain, and session name from configuration.
  */
@@ -731,7 +741,7 @@ function drupal_settings_initialize() {
   if (file_exists(DRUPAL_ROOT . '/' . conf_path() . '/settings.php')) {
     include_once DRUPAL_ROOT . '/' . conf_path() . '/settings.php';
   }
-  $is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
+  $is_https = drupal_is_https();
 
   if (isset($base_url)) {
     // Parse fixed base URL from settings.php.

+ 12 - 2
includes/cache.inc

@@ -122,7 +122,12 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
  *     the administrator panel.
  *   - cache_path: Stores the system paths that have an alias.
  * @param $expire
- *   (optional) One of the following values:
+ *   (optional) Controls the maximum lifetime of this cache entry. Note that
+ *   caches might be subject to clearing at any time, so this setting does not
+ *   guarantee a minimum lifetime. With this in mind, the cache should not be
+ *   used for data that must be kept during a cache clear, like sessions.
+ *
+ *   Use 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
@@ -262,7 +267,12 @@ interface DrupalCacheInterface {
    *   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
-   *   (optional) One of the following values:
+   *   (optional) Controls the maximum lifetime of this cache entry. Note that
+   *   caches might be subject to clearing at any time, so this setting does not
+   *   guarantee a minimum lifetime. With this in mind, the cache should not be
+   *   used for data that must be kept during a cache clear, like sessions.
+   *
+   *   Use 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

+ 9 - 2
includes/common.inc

@@ -3986,7 +3986,11 @@ function drupal_html_id($id) {
   // be merged with content already on the base page. The HTML IDs must be
   // unique for the fully merged content. Therefore, initialize $seen_ids to
   // take into account IDs that are already in use on the base page.
-  $seen_ids_init = &drupal_static(__FUNCTION__ . ':init');
+  static $drupal_static_fast;
+  if (!isset($drupal_static_fast['seen_ids_init'])) {
+    $drupal_static_fast['seen_ids_init'] = &drupal_static(__FUNCTION__ . ':init');
+  }
+  $seen_ids_init = &$drupal_static_fast['seen_ids_init'];
   if (!isset($seen_ids_init)) {
     // Ideally, Drupal would provide an API to persist state information about
     // prior page requests in the database, and we'd be able to add this
@@ -4031,7 +4035,10 @@ function drupal_html_id($id) {
       }
     }
   }
-  $seen_ids = &drupal_static(__FUNCTION__, $seen_ids_init);
+  if (!isset($drupal_static_fast['seen_ids'])) {
+    $drupal_static_fast['seen_ids'] = &drupal_static(__FUNCTION__, $seen_ids_init);
+  }
+  $seen_ids = &$drupal_static_fast['seen_ids'];
 
   $id = strtr(drupal_strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
 

+ 10 - 10
includes/date.inc

@@ -12,11 +12,6 @@ function system_default_date_formats() {
   $formats = array();
 
   // Short date formats.
-  $formats[] = array(
-    'type' => 'short',
-    'format' => 'Y-m-d H:i',
-    'locales' => array(),
-  );
   $formats[] = array(
     'type' => 'short',
     'format' => 'm/d/Y - H:i',
@@ -37,6 +32,11 @@ function system_default_date_formats() {
     'format' => 'd.m.Y - H:i',
     'locales' => array('de-ch', 'de-de', 'de-lu', 'fi-fi', 'fr-ch', 'is-is', 'pl-pl', 'ro-ro', 'ru-ru'),
   );
+  $formats[] = array(
+    'type' => 'short',
+    'format' => 'Y-m-d H:i',
+    'locales' => array(),
+  );
   $formats[] = array(
     'type' => 'short',
     'format' => 'm/d/Y - g:ia',
@@ -84,11 +84,6 @@ function system_default_date_formats() {
   );
 
   // Medium date formats.
-  $formats[] = array(
-    'type' => 'medium',
-    'format' => 'D, Y-m-d H:i',
-    'locales' => array(),
-  );
   $formats[] = array(
     'type' => 'medium',
     'format' => 'D, m/d/Y - H:i',
@@ -104,6 +99,11 @@ function system_default_date_formats() {
     'format' => 'D, Y/m/d - H:i',
     'locales' => array('en-ca', 'fr-ca', 'no-no', 'sv-se'),
   );
+  $formats[] = array(
+    'type' => 'medium',
+    'format' => 'D, Y-m-d H:i',
+    'locales' => array(),
+  );
   $formats[] = array(
     'type' => 'medium',
     'format' => 'F j, Y - H:i',

+ 2 - 2
includes/form.inc

@@ -1176,7 +1176,7 @@ function drupal_validate_form($form_id, &$form, &$form_state) {
   // If the session token was set by drupal_prepare_form(), ensure that it
   // matches the current user's session. This is duplicate to code in
   // form_builder() but left to protect any custom form handling code.
-  if (isset($form['#token'])) {
+  if (!empty($form['#token'])) {
     if (!drupal_valid_token($form_state['values']['form_token'], $form['#token']) || !empty($form_state['invalid_token'])) {
       _drupal_invalid_token_set_form_error();
       // Stop here and don't run any further validation handlers, because they
@@ -1837,7 +1837,7 @@ function form_builder($form_id, &$element, &$form_state) {
       // If the session token was set by drupal_prepare_form(), ensure that it
       // matches the current user's session.
       $form_state['invalid_token'] = FALSE;
-      if (isset($element['#token'])) {
+      if (!empty($element['#token'])) {
         if (empty($form_state['input']['form_token']) || !drupal_valid_token($form_state['input']['form_token'], $element['#token'])) {
           // Set an early form error to block certain input processing since that
           // opens the door for CSRF vulnerabilities.

+ 2 - 1
includes/menu.inc

@@ -1606,6 +1606,7 @@ function _menu_tree_data(&$links, $parents, $depth) {
  * Implements template_preprocess_HOOK() for theme_menu_tree().
  */
 function template_preprocess_menu_tree(&$variables) {
+  $variables['#tree'] = $variables['tree'];
   $variables['tree'] = $variables['tree']['#children'];
 }
 
@@ -2682,7 +2683,7 @@ function menu_link_load($mlid) {
 }
 
 /**
- * Clears the cached cached data for a single named menu.
+ * Clears the cached data for a single named menu.
  */
 function menu_cache_clear($menu_name = 'navigation') {
   $cache_cleared = &drupal_static(__FUNCTION__, array());

+ 150 - 2
includes/stream_wrappers.inc

@@ -133,7 +133,7 @@ interface DrupalStreamWrapperInterface extends StreamWrapperInterface {
    * @param $uri
    *   A string containing the URI that should be used for this instance.
    */
-  function setUri($uri);
+  public function setUri($uri);
 
   /**
    * Returns the stream resource URI.
@@ -219,7 +219,6 @@ interface DrupalStreamWrapperInterface extends StreamWrapperInterface {
   public function dirname($uri = NULL);
 }
 
-
 /**
  * Drupal stream wrapper base class for local files.
  *
@@ -549,6 +548,155 @@ abstract class DrupalLocalStreamWrapper implements DrupalStreamWrapperInterface
     return fclose($this->handle);
   }
 
+  /**
+   * Sets metadata on the stream.
+   *
+   * WARNING: Do not call this method directly! It will be called internally by
+   * PHP itself when one of the following functions is called on a stream URL:
+   *
+   * @param string $uri
+   *   A string containing the URI to the file to set metadata on.
+   * @param int $option
+   *   One of:
+   *   - STREAM_META_TOUCH: The method was called in response to touch().
+   *   - STREAM_META_OWNER_NAME: The method was called in response to chown()
+   *     with string parameter.
+   *   - STREAM_META_OWNER: The method was called in response to chown().
+   *   - STREAM_META_GROUP_NAME: The method was called in response to chgrp().
+   *   - STREAM_META_GROUP: The method was called in response to chgrp().
+   *   - STREAM_META_ACCESS: The method was called in response to chmod().
+   * @param mixed $value
+   *   If option is:
+   *   - STREAM_META_TOUCH: Array consisting of two arguments of the touch()
+   *     function.
+   *   - STREAM_META_OWNER_NAME or STREAM_META_GROUP_NAME: The name of the owner
+   *     user/group as string.
+   *   - STREAM_META_OWNER or STREAM_META_GROUP: The value of the owner
+   *     user/group as integer.
+   *   - STREAM_META_ACCESS: The argument of the chmod() as integer.
+   *
+   * @return bool
+   *   Returns TRUE on success or FALSE on failure. If $option is not
+   *   implemented, FALSE should be returned.
+   *
+   * @see touch()
+   * @see chmod()
+   * @see chown()
+   * @see chgrp()
+   * @link http://php.net/manual/streamwrapper.stream-metadata.php
+   */
+  public function stream_metadata($uri, $option, $value) {
+    $target = $this->getLocalPath($uri);
+    $return = FALSE;
+    switch ($option) {
+      case STREAM_META_TOUCH:
+        if (!empty($value)) {
+          $return = touch($target, $value[0], $value[1]);
+        }
+        else {
+          $return = touch($target);
+        }
+        break;
+
+      case STREAM_META_OWNER_NAME:
+      case STREAM_META_OWNER:
+        $return = chown($target, $value);
+        break;
+
+      case STREAM_META_GROUP_NAME:
+      case STREAM_META_GROUP:
+        $return = chgrp($target, $value);
+        break;
+
+      case STREAM_META_ACCESS:
+        $return = chmod($target, $value);
+        break;
+    }
+    if ($return) {
+      // For convenience clear the file status cache of the underlying file,
+      // since metadata operations are often followed by file status checks.
+      clearstatcache(TRUE, $target);
+    }
+    return $return;
+  }
+
+  /**
+   * Truncate stream.
+   *
+   * Will respond to truncation; e.g., through ftruncate().
+   *
+   * @param int $new_size
+   *   The new size.
+   *
+   * @return bool
+   *   TRUE on success, FALSE otherwise.
+   */
+  public function stream_truncate($new_size) {
+    return ftruncate($this->handle, $new_size);
+  }
+
+  /**
+   * Retrieve the underlying stream resource.
+   *
+   * This method is called in response to stream_select().
+   *
+   * @param int $cast_as
+   *   Can be STREAM_CAST_FOR_SELECT when stream_select() is calling
+   *   stream_cast() or STREAM_CAST_AS_STREAM when stream_cast() is called for
+   *   other uses.
+   *
+   * @return resource|false
+   *   The underlying stream resource or FALSE if stream_select() is not
+   *   supported.
+   *
+   * @see stream_select()
+   * @link http://php.net/manual/streamwrapper.stream-cast.php
+   */
+  public function stream_cast($cast_as) {
+    return $this->handle ? $this->handle : FALSE;
+  }
+
+  /**
+   * Change stream options.
+   *
+   * This method is called to set options on the stream.
+   *
+   * Since Windows systems do not allow it and it is not needed for most use
+   * cases anyway, this method is not supported on local files and will trigger
+   * an error and return false. If needed, custom subclasses can provide
+   * OS-specific implementations for advanced use cases.
+   *
+   * @param int $option
+   *   One of:
+   *   - STREAM_OPTION_BLOCKING: The method was called in response to
+   *     stream_set_blocking().
+   *   - STREAM_OPTION_READ_TIMEOUT: The method was called in response to
+   *     stream_set_timeout().
+   *   - STREAM_OPTION_WRITE_BUFFER: The method was called in response to
+   *     stream_set_write_buffer().
+   * @param int $arg1
+   *   If option is:
+   *   - STREAM_OPTION_BLOCKING: The requested blocking mode:
+   *     - 1 means blocking.
+   *     - 0 means not blocking.
+   *   - STREAM_OPTION_READ_TIMEOUT: The timeout in seconds.
+   *   - STREAM_OPTION_WRITE_BUFFER: The buffer mode, STREAM_BUFFER_NONE or
+   *     STREAM_BUFFER_FULL.
+   * @param int $arg2
+   *   If option is:
+   *   - STREAM_OPTION_BLOCKING: This option is not set.
+   *   - STREAM_OPTION_READ_TIMEOUT: The timeout in microseconds.
+   *   - STREAM_OPTION_WRITE_BUFFER: The requested buffer size.
+   *
+   * @return bool
+   *   TRUE on success, FALSE otherwise. If $option is not implemented, FALSE
+   *   should be returned.
+   */
+  public function stream_set_option($option, $arg1, $arg2) {
+    trigger_error('stream_set_option() not supported for local file based stream wrappers', E_USER_WARNING);
+    return FALSE;
+  }
+
   /**
    * Support for unlink().
    *

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/blog/blog.info

@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = blog.test
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/color/color.info

@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = color.test
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 1 - 1
modules/color/color.test

@@ -122,7 +122,7 @@ class ColorTestCase extends DrupalWebTestCase {
       $edit['palette[bg]'] = $color;
       $this->drupalPost($settings_path, $edit, t('Save configuration'));
 
-      if($is_valid) {
+      if ($is_valid) {
         $this->assertText('The configuration options have been saved.');
       }
       else {

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 8 - 2
modules/comment/comment.test

@@ -11,7 +11,13 @@ class CommentHelperCase extends DrupalWebTestCase {
   protected $node;
 
   function setUp() {
-    parent::setUp('comment', 'search');
+    $modules = func_get_args();
+    if (isset($modules[0]) && is_array($modules[0])) {
+      $modules = $modules[0];
+    }
+    $modules[] = 'comment';
+    parent::setUp($modules);
+
     // Create users and test node.
     $this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer comments', 'administer blocks', 'administer actions', 'administer fields'));
     $this->web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'create article content', 'edit own comments'));
@@ -1490,7 +1496,7 @@ class CommentNodeAccessTest extends CommentHelperCase {
   }
 
   function setUp() {
-    DrupalWebTestCase::setUp('comment', 'search', 'node_access_test');
+    parent::setUp('search', 'node_access_test');
     node_access_rebuild();
 
     // Create users and test node.

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/contextual/contextual.info

@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = contextual.test
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 1 - 1
modules/dblog/dblog.admin.inc

@@ -420,6 +420,6 @@ function dblog_clear_log_form($form) {
  */
 function dblog_clear_log_submit() {
   $_SESSION['dblog_overview_filter'] = array();
-  db_delete('watchdog')->execute();
+  db_truncate('watchdog')->execute();
   drupal_set_message(t('Database log cleared.'));
 }

+ 3 - 3
modules/dblog/dblog.info

@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = dblog.test
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 9 - 0
modules/field/modules/number/number.module

@@ -164,6 +164,15 @@ function number_field_presave($entity_type, $entity, $field, $instance, $langcod
       }
     }
   }
+  if ($field['type'] == 'number_float') {
+    // Remove the decimal point from float values with decimal
+    // point but no decimal numbers.
+    foreach ($items as $delta => $item) {
+      if (isset($item['value'])) {
+        $items[$delta]['value'] = floatval($item['value']);
+      }
+    }
+  }
 }
 
 /**

+ 46 - 0
modules/field/modules/number/number.test

@@ -152,4 +152,50 @@ class NumberFieldTestCase extends DrupalWebTestCase {
     );
     $this->drupalPost(NULL, $edit, t('Save'));
   }
+
+  /**
+   * Test number_float field.
+   */
+  function testNumberFloatField() {
+    $this->field = array(
+      'field_name' => drupal_strtolower($this->randomName()),
+      'type' => 'number_float',
+      'settings' => array(
+        'precision' => 8, 'scale' => 4, 'decimal_separator' => '.',
+      )
+    );
+    field_create_field($this->field);
+    $this->instance = array(
+      'field_name' => $this->field['field_name'],
+      'entity_type' => 'test_entity',
+      'bundle' => 'test_bundle',
+      'widget' => array(
+        'type' => 'number',
+      ),
+      'display' => array(
+        'default' => array(
+          'type' => 'number_float',
+        ),
+      ),
+    );
+    field_create_instance($this->instance);
+
+    $langcode = LANGUAGE_NONE;
+    $value = array(
+      '9.' => '9',
+      '.' => '0',
+      '123.55' => '123.55',
+      '.55' => '0.55',
+      '-0.55' => '-0.55',
+    );
+    foreach($value as $key => $value) {
+      $edit = array(
+        "{$this->field['field_name']}[$langcode][0][value]" => $key,
+      );
+      $this->drupalPost('test-entity/add/test-bundle', $edit, t('Save'));
+      $this->assertNoText("PDOException");
+      $this->assertRaw($value, 'Correct value is displayed.');
+    }
+  }
+
 }

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 22 - 6
modules/field/modules/options/options.test

@@ -23,8 +23,15 @@ class OptionsWidgetsTestCase extends FieldTestCase {
       'type' => 'list_integer',
       'cardinality' => 1,
       'settings' => array(
-        // Make sure that 0 works as an option.
-        'allowed_values' => array(0 => 'Zero', 1 => 'One', 2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>',  3 => 'Some HTML encoded markup with &lt; &amp; &gt;'),
+        'allowed_values' => array(
+          // Make sure that 0 works as an option.
+          0 => 'Zero',
+          1 => 'One',
+          // Make sure that option text is properly sanitized.
+          2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>',
+          // Make sure that HTML entities in option text are not double-encoded.
+          3 => 'Some HTML encoded markup with &lt; &amp; &gt;',
+        ),
       ),
     );
     $this->card_1 = field_create_field($this->card_1);
@@ -35,8 +42,13 @@ class OptionsWidgetsTestCase extends FieldTestCase {
       'type' => 'list_integer',
       'cardinality' => 2,
       'settings' => array(
-        // Make sure that 0 works as an option.
-        'allowed_values' => array(0 => 'Zero', 1 => 'One', 2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>'),
+        'allowed_values' => array(
+          // Make sure that 0 works as an option.
+          0 => 'Zero',
+          1 => 'One',
+          // Make sure that option text is properly sanitized.
+          2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>',
+        ),
       ),
     );
     $this->card_2 = field_create_field($this->card_2);
@@ -47,8 +59,12 @@ class OptionsWidgetsTestCase extends FieldTestCase {
       'type' => 'list_boolean',
       'cardinality' => 1,
       'settings' => array(
-        // Make sure that 0 works as a 'on' value'.
-        'allowed_values' => array(1 => 'Zero', 0 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>'),
+        'allowed_values' => array(
+          // Make sure that 1 works as a 'on' value'.
+          1 => 'Zero',
+          // Make sure that option text is properly sanitized.
+          0 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>',
+        ),
       ),
     );
     $this->bool = field_create_field($this->bool);

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 2 - 1
modules/file/file.module

@@ -280,7 +280,8 @@ function file_ajax_upload() {
     $form['#suffix'] .= '<span class="ajax-new-content"></span>';
   }
 
-  $output = theme('status_messages') . drupal_render($form);
+  $form['#prefix'] .= theme('status_messages');
+  $output = drupal_render($form);
   $js = drupal_add_js();
   $settings = call_user_func_array('array_merge_recursive', $js['settings']['data']);
 

+ 50 - 0
modules/file/tests/file.test

@@ -596,6 +596,56 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
     $this->doTestTemporaryFileRemovalExploit($victim_uid, $attacker_uid);
   }
 
+  /**
+   * Tests validation with the Upload button.
+   */
+  function testWidgetValidation() {
+    $type_name = 'article';
+    $field_name = strtolower($this->randomName());
+    $this->createFileField($field_name, $type_name);
+    $this->updateFileField($field_name, $type_name, array('file_extensions' => 'txt'));
+
+    foreach (array('nojs', 'js') as $type) {
+      // Create node and prepare files for upload.
+      $node = $this->drupalCreateNode(array('type' => 'article'));
+      $nid = $node->nid;
+      $this->drupalGet("node/$nid/edit");
+      $test_file_text = $this->getTestFile('text');
+      $test_file_image = $this->getTestFile('image');
+      $field = field_info_field($field_name);
+      $name = 'files[' . $field_name . '_' . LANGUAGE_NONE . '_0]';
+
+      // Upload file with incorrect extension, check for validation error.
+      $edit[$name] = drupal_realpath($test_file_image->uri);
+      switch ($type) {
+        case 'nojs':
+          $this->drupalPost(NULL, $edit, t('Upload'));
+          break;
+
+        case 'js':
+          $button = $this->xpath('//input[@type="submit" and @value="' . t('Upload') . '"]');
+          $this->drupalPostAJAX(NULL, $edit, array((string) $button[0]['name'] => (string) $button[0]['value']));
+          break;
+      }
+      $error_message = t('Only files with the following extensions are allowed: %files-allowed.', array('%files-allowed' => 'txt'));
+      $this->assertRaw($error_message, t('Validation error when file with wrong extension uploaded (JSMode=%type).', array('%type' => $type)));
+
+      // Upload file with correct extension, check that error message is removed.
+      $edit[$name] = drupal_realpath($test_file_text->uri);
+      switch ($type) {
+        case 'nojs':
+          $this->drupalPost(NULL, $edit, t('Upload'));
+          break;
+
+        case 'js':
+          $button = $this->xpath('//input[@type="submit" and @value="' . t('Upload') . '"]');
+          $this->drupalPostAJAX(NULL, $edit, array((string) $button[0]['name'] => (string) $button[0]['value']));
+          break;
+      }
+      $this->assertNoRaw($error_message, t('Validation error removed when file with correct extension uploaded (JSMode=%type).', array('%type' => $type)));
+    }
+  }
+
   /**
    * Helper for testing exploiting the temporary file removal using fid.
    *

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 1 - 1
modules/filter/filter.module

@@ -1638,7 +1638,7 @@ function _filter_url_escape_comments($match, $escape = NULL) {
   // Replace all HTML coments with a '<!-- [hash] -->' placeholder.
   if ($mode) {
     $content = $match[1];
-    $hash = md5($content);
+    $hash = hash('sha256', $content);
     $comments[$hash] = $content;
     return "<!-- $hash -->";
   }

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/help/help.info

@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = help.test
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/locale/tests/locale_test.info

@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/openid/openid.info

@@ -5,8 +5,8 @@ package = Core
 core = 7.x
 files[] = openid.test
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/overlay/overlay.info

@@ -4,8 +4,8 @@ package = Core
 version = VERSION
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/php/php.info

@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = php.test
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/rdf/rdf.info

@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = rdf.test
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/rdf/tests/rdf_test.info

@@ -6,8 +6,8 @@ core = 7.x
 hidden = TRUE
 dependencies[] = blog
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 10 - 0
modules/search/search.admin.inc

@@ -125,6 +125,16 @@ function search_admin_settings($form) {
     '#options' => $module_options,
     '#description' => t('Choose which search module is the default.')
   );
+  $form['logging'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Logging')
+  );
+  $form['logging']['search_logging'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Log searches'),
+    '#default_value' => variable_get('search_logging', 1),
+    '#description' => t('If checked, all searches will be logged. Uncheck to skip logging. Logging may affect performance.'),
+  );
   $form['#validate'][] = 'search_admin_settings_validate';
   $form['#submit'][] = 'search_admin_settings_submit';
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 1 - 0
modules/search/search.install

@@ -12,6 +12,7 @@ function search_uninstall() {
   variable_del('minimum_word_size');
   variable_del('overlap_cjk');
   variable_del('search_cron_limit');
+  variable_del('search_logging');
 }
 
 /**

+ 4 - 3
modules/search/search.pages.inc

@@ -57,9 +57,10 @@ function search_view($module = NULL, $keys = '') {
     }
     // Only search if there are keywords or non-empty conditions.
     if ($keys || !empty($conditions)) {
-      // Log the search keys.
-      watchdog('search', 'Searched %type for %keys.', array('%keys' => $keys, '%type' => $info['title']), WATCHDOG_NOTICE, l(t('results'), 'search/' . $info['path'] . '/' . $keys));
-
+       if (variable_get('search_logging', TRUE)) {
+         // Log the search keys.
+         watchdog('search', 'Searched %type for %keys.', array('%keys' => $keys, '%type' => $info['title']), WATCHDOG_NOTICE, l(t('results'), 'search/' . $info['path'] . '/' . $keys));
+       }
       // Collect the search results.
       $results = search_data($keys, $info['module'], $conditions);
     }

+ 14 - 1
modules/search/search.test

@@ -1453,7 +1453,7 @@ class SearchConfigSettingsForm extends DrupalWebTestCase {
     parent::setUp('search', 'search_extra_type');
 
     // Login as a user that can create and search content.
-    $this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks'));
+    $this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks', 'access site reports'));
     $this->drupalLogin($this->search_user);
 
     // Add a single piece of content and index it.
@@ -1502,6 +1502,19 @@ class SearchConfigSettingsForm extends DrupalWebTestCase {
     );
     $this->drupalPost('admin/config/search/settings', $edit, t('Save configuration'));
     $this->assertNoText(t('The configuration options have been saved.'), 'Form does not save with an invalid word length.');
+
+    // Test logging setting. It should be on by default.
+    $text = $this->randomName(5);
+    $this->drupalPost('search/node', array('keys' => $text), t('Search'));
+    $this->drupalGet('admin/reports/dblog');
+    $this->assertLink('Searched Content for ' . $text . '.', 0, 'Search was logged');
+
+    // Turn off logging.
+    variable_set('search_logging', FALSE);
+    $text = $this->randomName(5);
+    $this->drupalPost('search/node', array('keys' => $text), t('Search'));
+    $this->drupalGet('admin/reports/dblog');
+    $this->assertNoLink('Searched Content for ' . $text . '.', 'Search was not logged');
   }
 
   /**

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/search/tests/search_node_tags.info

@@ -5,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 7 - 5
modules/simpletest/drupal_web_test_case.php

@@ -1374,10 +1374,11 @@ class DrupalWebTestCase extends DrupalTestCase {
    * @see DrupalWebTestCase::tearDown()
    */
   protected function prepareEnvironment() {
-    global $user, $language, $conf;
+    global $user, $language, $language_url, $conf;
 
     // Store necessary current values before switching to prefixed database.
     $this->originalLanguage = $language;
+    $this->originalLanguageUrl = $language_url;
     $this->originalLanguageDefault = variable_get('language_default');
     $this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files');
     $this->originalProfile = drupal_get_profile();
@@ -1387,7 +1388,7 @@ class DrupalWebTestCase extends DrupalTestCase {
     // Set to English to prevent exceptions from utf8_truncate() from t()
     // during install if the current language is not 'en'.
     // The following array/object conversion is copied from language_default().
-    $language = (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => '');
+    $language_url = $language = (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => '');
 
     // Save and clean the shutdown callbacks array because it is static cached
     // and will be changed by the test run. Otherwise it will contain callbacks
@@ -1445,7 +1446,7 @@ class DrupalWebTestCase extends DrupalTestCase {
    * @see DrupalWebTestCase::prepareEnvironment()
    */
   protected function setUp() {
-    global $user, $language, $conf;
+    global $user, $language, $language_url, $conf;
 
     // Create the database prefix for this test.
     $this->prepareDatabasePrefix();
@@ -1542,7 +1543,7 @@ class DrupalWebTestCase extends DrupalTestCase {
 
     // Set up English language.
     unset($conf['language_default']);
-    $language = language_default();
+    $language_url = $language = language_default();
 
     // Use the test mail class instead of the default mail handler class.
     variable_set('mail_system', array('default-system' => 'TestingMailSystem'));
@@ -1636,7 +1637,7 @@ class DrupalWebTestCase extends DrupalTestCase {
    * and reset the database prefix.
    */
   protected function tearDown() {
-    global $user, $language;
+    global $user, $language, $language_url;
 
     // In case a fatal error occurred that was not in the test process read the
     // log to pick up any fatal errors.
@@ -1701,6 +1702,7 @@ class DrupalWebTestCase extends DrupalTestCase {
 
     // Reset language.
     $language = $this->originalLanguage;
+    $language_url = $this->originalLanguageUrl;
     if ($this->originalLanguageDefault) {
       $GLOBALS['conf']['language_default'] = $this->originalLanguageDefault;
     }

+ 3 - 3
modules/simpletest/simpletest.info

@@ -57,8 +57,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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/simpletest/tests/boot_test_1.info

@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/simpletest/tests/boot_test_2.info

@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/simpletest/tests/database_test.info

@@ -5,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.info

@@ -7,8 +7,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 8 - 0
modules/simpletest/tests/form.test

@@ -690,6 +690,14 @@ class FormValidationTestCase extends DrupalWebTestCase {
     $this->assertText('The form has become outdated. Copy any unsaved work in the form below');
   }
 
+  /**
+   * Tests that a form with a disabled CSRF token can be validated.
+   */
+  function testDisabledToken() {
+    $this->drupalPost('form-test/validate-no-token', array(), 'Save');
+    $this->assertText('The form_test_validate_no_token form has been submitted successfully.');
+  }
+
   /**
    * Tests partial form validation through #limit_validation_errors.
    */

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 28 - 0
modules/simpletest/tests/form_test.module

@@ -37,6 +37,13 @@ function form_test_menu() {
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
   );
+  $items['form-test/validate-no-token'] = array(
+    'title' => 'Form validation without a CSRF token',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('form_test_validate_no_token'),
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
   $items['form-test/limit-validation-errors'] = array(
     'title' => 'Form validation with some error suppression',
     'page callback' => 'drupal_get_form',
@@ -454,6 +461,27 @@ function form_test_validate_required_form_no_title_submit($form, &$form_state) {
   drupal_set_message('The form_test_validate_required_form_no_title form was submitted successfully.');
 }
 
+/**
+ * Form builder for testing submission of a form without a CSRF token.
+ */
+function form_test_validate_no_token($form, &$form_state) {
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => 'Save',
+  );
+
+  $form['#token'] = FALSE;
+
+  return $form;
+}
+
+/**
+ * Form submission handler for form_test_validate_no_token().
+ */
+function form_test_validate_no_token_submit($form, &$form_state) {
+  drupal_set_message('The form_test_validate_no_token form has been submitted successfully.');
+}
+
 /**
  * Builds a simple form with a button triggering partial validation.
  */

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

+ 3 - 3
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 2016-12-07
-version = "7.53"
+; Information added by Drupal.org packaging script on 2017-02-01
+version = "7.54"
 project = "drupal"
-datestamp = "1481152423"
+datestamp = "1485986921"
 

Some files were not shown because too many files changed in this diff