Browse Source

updated core to 7.65

Bachir Soussi Chiadmi 5 years ago
parent
commit
6fb9e4806d
100 changed files with 100 additions and 9 deletions
  1. 16 0
      CHANGELOG.txt
  2. 0 0
      COPYRIGHT.txt
  3. 0 0
      MAINTAINERS.txt
  4. 0 0
      README.txt
  5. 0 0
      UPGRADE.txt
  6. 0 0
      authorize.php
  7. 0 0
      cron.php
  8. 0 0
      includes/actions.inc
  9. 0 0
      includes/ajax.inc
  10. 0 0
      includes/archiver.inc
  11. 0 0
      includes/authorize.inc
  12. 0 0
      includes/batch.inc
  13. 0 0
      includes/batch.queue.inc
  14. 1 1
      includes/bootstrap.inc
  15. 0 0
      includes/cache-install.inc
  16. 0 0
      includes/cache.inc
  17. 5 0
      includes/common.inc
  18. 0 0
      includes/database/database.inc
  19. 0 0
      includes/database/log.inc
  20. 0 0
      includes/database/mysql/database.inc
  21. 0 0
      includes/database/mysql/install.inc
  22. 0 0
      includes/database/mysql/query.inc
  23. 0 0
      includes/database/mysql/schema.inc
  24. 0 0
      includes/database/pgsql/database.inc
  25. 0 0
      includes/database/pgsql/install.inc
  26. 0 0
      includes/database/pgsql/query.inc
  27. 0 0
      includes/database/pgsql/schema.inc
  28. 0 0
      includes/database/pgsql/select.inc
  29. 0 0
      includes/database/prefetch.inc
  30. 0 0
      includes/database/query.inc
  31. 0 0
      includes/database/schema.inc
  32. 0 0
      includes/database/select.inc
  33. 0 0
      includes/database/sqlite/database.inc
  34. 0 0
      includes/database/sqlite/install.inc
  35. 0 0
      includes/database/sqlite/query.inc
  36. 0 0
      includes/database/sqlite/schema.inc
  37. 0 0
      includes/database/sqlite/select.inc
  38. 0 0
      includes/date.inc
  39. 0 0
      includes/errors.inc
  40. 48 3
      includes/file.inc
  41. 0 0
      includes/file.mimetypes.inc
  42. 0 0
      includes/filetransfer/filetransfer.inc
  43. 0 0
      includes/filetransfer/ftp.inc
  44. 0 0
      includes/filetransfer/local.inc
  45. 0 0
      includes/filetransfer/ssh.inc
  46. 0 0
      includes/form.inc
  47. 0 0
      includes/graph.inc
  48. 0 0
      includes/image.inc
  49. 0 0
      includes/install.core.inc
  50. 0 0
      includes/install.inc
  51. 0 0
      includes/iso.inc
  52. 0 0
      includes/json-encode.inc
  53. 0 0
      includes/language.inc
  54. 0 0
      includes/locale.inc
  55. 0 0
      includes/lock.inc
  56. 0 0
      includes/mail.inc
  57. 0 0
      includes/menu.inc
  58. 0 0
      includes/module.inc
  59. 0 0
      includes/pager.inc
  60. 0 0
      includes/password.inc
  61. 0 0
      includes/path.inc
  62. 30 5
      includes/registry.inc
  63. 0 0
      includes/session.inc
  64. 0 0
      includes/stream_wrappers.inc
  65. 0 0
      includes/tablesort.inc
  66. 0 0
      includes/theme.inc
  67. 0 0
      includes/theme.maintenance.inc
  68. 0 0
      includes/token.inc
  69. 0 0
      includes/unicode.entities.inc
  70. 0 0
      includes/unicode.inc
  71. 0 0
      includes/update.inc
  72. 0 0
      includes/updater.inc
  73. 0 0
      includes/utility.inc
  74. 0 0
      includes/xmlrpc.inc
  75. 0 0
      includes/xmlrpcs.inc
  76. 0 0
      index.php
  77. 0 0
      misc/ajax.js
  78. 0 0
      misc/arrow-asc.png
  79. 0 0
      misc/arrow-desc.png
  80. 0 0
      misc/authorize.js
  81. 0 0
      misc/autocomplete.js
  82. 0 0
      misc/batch.js
  83. 0 0
      misc/collapse.js
  84. 0 0
      misc/configure.png
  85. 0 0
      misc/draggable.png
  86. 0 0
      misc/drupal.js
  87. 0 0
      misc/druplicon.png
  88. 0 0
      misc/farbtastic/farbtastic.css
  89. 0 0
      misc/farbtastic/farbtastic.js
  90. 0 0
      misc/farbtastic/marker.png
  91. 0 0
      misc/farbtastic/mask.png
  92. 0 0
      misc/farbtastic/wheel.png
  93. 0 0
      misc/favicon.ico
  94. 0 0
      misc/feed.png
  95. 0 0
      misc/form.js
  96. 0 0
      misc/forum-icons.png
  97. 0 0
      misc/grippie.png
  98. 0 0
      misc/help.png
  99. 0 0
      misc/jquery.ba-bbq.js
  100. 0 0
      misc/jquery.cookie.js

+ 16 - 0
CHANGELOG.txt

@@ -1,3 +1,19 @@
+Drupal 7.xx, xxxx-xx-xx (development version)
+-----------------------
+
+Drupal 7.65, 2019-03-20
+-----------------------
+- Fixed security issues:
+   - SA-CORE-2019-004
+
+Drupal 7.64, 2019-02-06
+-----------------------
+- [regression] Unset the 'host' header in drupal_http_request() during redirect
+- Fixed: 7.x does not have Phar protection and Phar tests are failing on Drupal 7
+- Fixed: Notice: Undefined index: display_field in file_field_widget_value() (line 582 of /module/file/file.field.inc)
+- Performance improvement: Registry rebuild should not parse the same file twice in the same request
+- Fixed _registry_update() to clear caches after transaction is committed
+
 Drupal 7.63, 2019-01-16
 -----------------------
 - Fixed a fatal error for some Drush users introduced by SA-CORE-2019-002.

+ 0 - 0
COPYRIGHT.txt


+ 0 - 0
MAINTAINERS.txt


+ 0 - 0
README.txt


+ 0 - 0
UPGRADE.txt


+ 0 - 0
authorize.php


+ 0 - 0
cron.php


+ 0 - 0
includes/actions.inc


+ 0 - 0
includes/ajax.inc


+ 0 - 0
includes/archiver.inc


+ 0 - 0
includes/authorize.inc


+ 0 - 0
includes/batch.inc


+ 0 - 0
includes/batch.queue.inc


+ 1 - 1
includes/bootstrap.inc

@@ -8,7 +8,7 @@
 /**
  * The current system version.
  */
-define('VERSION', '7.63');
+define('VERSION', '7.65');
 
 /**
  * Core API compatibility.

+ 0 - 0
includes/cache-install.inc


+ 0 - 0
includes/cache.inc


+ 5 - 0
includes/common.inc

@@ -1094,6 +1094,11 @@ function drupal_http_request($url, array $options = array()) {
       elseif ($options['max_redirects']) {
         // Redirect to the new location.
         $options['max_redirects']--;
+
+        // We need to unset the 'Host' header
+        // as we are redirecting to a new location.
+        unset($options['headers']['Host']);
+
         $result = drupal_http_request($location, $options);
         $result->redirect_code = $code;
       }

+ 0 - 0
includes/database/database.inc


+ 0 - 0
includes/database/log.inc


+ 0 - 0
includes/database/mysql/database.inc


+ 0 - 0
includes/database/mysql/install.inc


+ 0 - 0
includes/database/mysql/query.inc


+ 0 - 0
includes/database/mysql/schema.inc


+ 0 - 0
includes/database/pgsql/database.inc


+ 0 - 0
includes/database/pgsql/install.inc


+ 0 - 0
includes/database/pgsql/query.inc


+ 0 - 0
includes/database/pgsql/schema.inc


+ 0 - 0
includes/database/pgsql/select.inc


+ 0 - 0
includes/database/prefetch.inc


+ 0 - 0
includes/database/query.inc


+ 0 - 0
includes/database/schema.inc


+ 0 - 0
includes/database/select.inc


+ 0 - 0
includes/database/sqlite/database.inc


+ 0 - 0
includes/database/sqlite/install.inc


+ 0 - 0
includes/database/sqlite/query.inc


+ 0 - 0
includes/database/sqlite/schema.inc


+ 0 - 0
includes/database/sqlite/select.inc


+ 0 - 0
includes/date.inc


+ 0 - 0
includes/errors.inc


+ 48 - 3
includes/file.inc

@@ -993,8 +993,15 @@ function file_build_uri($path) {
  * @return
  *   The destination filepath, or FALSE if the file already exists
  *   and FILE_EXISTS_ERROR is specified.
+ *
+ * @throws RuntimeException
+ *   Thrown if the filename contains invalid UTF-8.
  */
 function file_destination($destination, $replace) {
+  $basename = drupal_basename($destination);
+  if (!drupal_validate_utf8($basename)) {
+    throw new RuntimeException(sprintf("Invalid filename '%s'", $basename));
+  }
   if (file_exists($destination)) {
     switch ($replace) {
       case FILE_EXISTS_REPLACE:
@@ -1002,7 +1009,6 @@ function file_destination($destination, $replace) {
         break;
 
       case FILE_EXISTS_RENAME:
-        $basename = drupal_basename($destination);
         $directory = drupal_dirname($destination);
         $destination = file_create_filename($basename, $directory);
         break;
@@ -1218,11 +1224,20 @@ function file_unmunge_filename($filename) {
  * @return
  *   File path consisting of $directory and a unique filename based off
  *   of $basename.
+ *
+ * @throws RuntimeException
+ *   Thrown if the $basename is not valid UTF-8 or another error occurs
+ *   stripping control characters.
  */
 function file_create_filename($basename, $directory) {
+  $original = $basename;
   // Strip control characters (ASCII value < 32). Though these are allowed in
   // some filesystems, not many applications handle them well.
   $basename = preg_replace('/[\x00-\x1F]/u', '_', $basename);
+  if (preg_last_error() !== PREG_NO_ERROR) {
+    throw new RuntimeException(sprintf("Invalid filename '%s'", $original));
+  }
+
   if (substr(PHP_OS, 0, 3) == 'WIN') {
     // These characters are not allowed in Windows filenames
     $basename = str_replace(array(':', '*', '?', '"', '<', '>', '|'), '_', $basename);
@@ -1563,7 +1578,13 @@ function file_save_upload($form_field_name, $validators = array(), $destination
   if (substr($destination, -1) != '/') {
     $destination .= '/';
   }
-  $file->destination = file_destination($destination . $file->filename, $replace);
+  try {
+    $file->destination = file_destination($destination . $file->filename, $replace);
+  }
+  catch (RuntimeException $e) {
+    drupal_set_message(t('The file %source could not be uploaded because the name is invalid.', array('%source' => $form_field_name)), 'error');
+    return FALSE;
+  }
   // If file_destination() returns FALSE then $replace == FILE_EXISTS_ERROR and
   // there's an existing file so we need to bail.
   if ($file->destination === FALSE) {
@@ -2130,9 +2151,33 @@ function file_download_access($uri) {
  *   'filename', and 'name' members corresponding to the matching files.
  */
 function file_scan_directory($dir, $mask, $options = array(), $depth = 0) {
+  // Default nomask option.
+  $nomask = '/(\.\.?|CVS)$/';
+
+  // Overrides the $nomask variable accordingly if $options['nomask'] is set.
+  //
+  // Allow directories specified in settings.php to be ignored. You can use this
+  // to not check for files in common special-purpose directories. For example,
+  // node_modules and bower_components. Ignoring irrelevant directories is a
+  // performance boost.
+  if (!isset($options['nomask'])) {
+    $ignore_directories = variable_get(
+      'file_scan_ignore_directories',
+      array()
+    );
+
+    foreach ($ignore_directories as $index => $ignore_directory) {
+      $ignore_directories[$index] = preg_quote($ignore_directory, '/');
+    }
+
+    if (!empty($ignore_directories)) {
+      $nomask = '/^(\.\.?)|CVS|' . implode('|', $ignore_directories) . '$/';
+    }
+  }
+
   // Merge in defaults.
   $options += array(
-    'nomask' => '/(\.\.?|CVS)$/',
+    'nomask' => $nomask,
     'callback' => 0,
     'recurse' => TRUE,
     'key' => 'uri',

+ 0 - 0
includes/file.mimetypes.inc


+ 0 - 0
includes/filetransfer/filetransfer.inc


+ 0 - 0
includes/filetransfer/ftp.inc


+ 0 - 0
includes/filetransfer/local.inc


+ 0 - 0
includes/filetransfer/ssh.inc


+ 0 - 0
includes/form.inc


+ 0 - 0
includes/graph.inc


+ 0 - 0
includes/image.inc


+ 0 - 0
includes/install.core.inc


+ 0 - 0
includes/install.inc


+ 0 - 0
includes/iso.inc


+ 0 - 0
includes/json-encode.inc


+ 0 - 0
includes/language.inc


+ 0 - 0
includes/locale.inc


+ 0 - 0
includes/lock.inc


+ 0 - 0
includes/mail.inc


+ 0 - 0
includes/menu.inc


+ 0 - 0
includes/module.inc


+ 0 - 0
includes/pager.inc


+ 0 - 0
includes/password.inc


+ 0 - 0
includes/path.inc


+ 30 - 5
includes/registry.inc

@@ -19,7 +19,6 @@
  * Does the work for registry_update().
  */
 function _registry_update() {
-
   // The registry serves as a central autoloader for all classes, including
   // the database query builders. However, the registry rebuild process
   // requires write ability to the database, which means having access to the
@@ -33,6 +32,11 @@ function _registry_update() {
   require_once DRUPAL_ROOT . '/includes/database/select.inc';
   require_once DRUPAL_ROOT . '/includes/database/' . $driver . '/query.inc';
 
+  // During the first registry rebuild in a request, we check all the files.
+  // During subsequent rebuilds, we only add new files. It makes the rebuilding
+  // process faster during installation of modules.
+  static $check_existing_files = TRUE;
+
   // Get current list of modules and their files.
   $modules = db_query("SELECT * FROM {system} WHERE type = 'module'")->fetchAll();
   // Get the list of files we are going to parse.
@@ -55,6 +59,9 @@ function _registry_update() {
     $files["$filename"] = array('module' => '', 'weight' => 0);
   }
 
+  // Initialize an empty array for the unchanged files.
+  $unchanged_files = array();
+
   $transaction = db_transaction();
   try {
     // Allow modules to manually modify the list of files before the registry
@@ -63,10 +70,19 @@ function _registry_update() {
     // list can then be added to the list of files that the registry will parse,
     // or modify attributes of a file.
     drupal_alter('registry_files', $files, $modules);
+
     foreach (registry_get_parsed_files() as $filename => $file) {
       // Add the hash for those files we have already parsed.
       if (isset($files[$filename])) {
-        $files[$filename]['hash'] = $file['hash'];
+        if ($check_existing_files === TRUE) {
+          $files[$filename]['hash'] = $file['hash'];
+        }
+        else {
+          // Ignore that file for this request, it has been parsed previously
+          // and it is unlikely it has changed.
+          unset($files[$filename]);
+          $unchanged_files[$filename] = $file;
+        }
       }
       else {
         // Flush the registry of resources in files that are no longer on disc
@@ -79,8 +95,12 @@ function _registry_update() {
           ->execute();
       }
     }
+
     $parsed_files = _registry_parse_files($files);
 
+    // Add unchanged files to the files.
+    $files += $unchanged_files;
+
     $unchanged_resources = array();
     $lookup_cache = array();
     if ($cache = cache_get('lookup_cache', 'cache_bootstrap')) {
@@ -89,12 +109,10 @@ function _registry_update() {
     foreach ($lookup_cache as $key => $file) {
       // If the file for this cached resource is carried over unchanged from
       // the last registry build, then we can safely re-cache it.
-      if ($file && in_array($file, array_keys($files)) && !in_array($file, $parsed_files)) {
+      if ($file && isset($files[$file]) && !in_array($file, $parsed_files, TRUE)) {
         $unchanged_resources[$key] = $file;
       }
     }
-    module_implements('', FALSE, TRUE);
-    _registry_check_code(REGISTRY_RESET_LOOKUP_CACHE);
   }
   catch (Exception $e) {
     $transaction->rollback();
@@ -102,6 +120,13 @@ function _registry_update() {
     throw $e;
   }
 
+  module_implements('', FALSE, TRUE);
+  _registry_check_code(REGISTRY_RESET_LOOKUP_CACHE);
+
+  // During the next run in this request, don't bother re-checking existing
+  // files.
+  $check_existing_files = FALSE;
+
   // We have some unchanged resources, warm up the cache - no need to pay
   // for looking them up again.
   if (count($unchanged_resources) > 0) {

+ 0 - 0
includes/session.inc


+ 0 - 0
includes/stream_wrappers.inc


+ 0 - 0
includes/tablesort.inc


+ 0 - 0
includes/theme.inc


+ 0 - 0
includes/theme.maintenance.inc


+ 0 - 0
includes/token.inc


+ 0 - 0
includes/unicode.entities.inc


+ 0 - 0
includes/unicode.inc


+ 0 - 0
includes/update.inc


+ 0 - 0
includes/updater.inc


+ 0 - 0
includes/utility.inc


+ 0 - 0
includes/xmlrpc.inc


+ 0 - 0
includes/xmlrpcs.inc


+ 0 - 0
index.php


+ 0 - 0
misc/ajax.js


+ 0 - 0
misc/arrow-asc.png


+ 0 - 0
misc/arrow-desc.png


+ 0 - 0
misc/authorize.js


+ 0 - 0
misc/autocomplete.js


+ 0 - 0
misc/batch.js


+ 0 - 0
misc/collapse.js


+ 0 - 0
misc/configure.png


+ 0 - 0
misc/draggable.png


+ 0 - 0
misc/drupal.js


+ 0 - 0
misc/druplicon.png


+ 0 - 0
misc/farbtastic/farbtastic.css


+ 0 - 0
misc/farbtastic/farbtastic.js


+ 0 - 0
misc/farbtastic/marker.png


+ 0 - 0
misc/farbtastic/mask.png


+ 0 - 0
misc/farbtastic/wheel.png


+ 0 - 0
misc/favicon.ico


+ 0 - 0
misc/feed.png


+ 0 - 0
misc/form.js


+ 0 - 0
misc/forum-icons.png


+ 0 - 0
misc/grippie.png


+ 0 - 0
misc/help.png


+ 0 - 0
misc/jquery.ba-bbq.js


+ 0 - 0
misc/jquery.cookie.js


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