updated core to 7.58, security update

This commit is contained in:
2018-04-24 23:28:54 +02:00
parent 83a28c5dc3
commit dc21b82664
357 changed files with 10830 additions and 2674 deletions
+137 -2
View File
@@ -160,7 +160,7 @@ function system_requirements($phase) {
if (empty($drivers)) {
$database_ok = FALSE;
$pdo_message = $t('Your web server does not appear to support any common PDO database extensions. Check with your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases that <a href="@drupal-databases">Drupal supports</a>.', array(
'@drupal-databases' => 'http://drupal.org/node/270#database',
'@drupal-databases' => 'https://www.drupal.org/requirements/database',
));
}
// Make sure the native PDO extension is available, not the older PEAR
@@ -196,6 +196,12 @@ function system_requirements($phase) {
);
}
// Test database-specific multi-byte UTF-8 related requirements.
$charset_requirements = _system_check_db_utf8mb4_requirements($phase);
if (!empty($charset_requirements)) {
$requirements['database_charset'] = $charset_requirements;
}
// Test PHP memory_limit
$memory_limit = ini_get('memory_limit');
$requirements['php_memory_limit'] = array(
@@ -517,6 +523,75 @@ function system_requirements($phase) {
return $requirements;
}
/**
* Checks whether the requirements for multi-byte UTF-8 support are met.
*
* @param string $phase
* The hook_requirements() stage.
*
* @return array
* A requirements array with the result of the charset check.
*/
function _system_check_db_utf8mb4_requirements($phase) {
global $install_state;
// In the requirements check of the installer, skip the utf8mb4 check unless
// the database connection info has been preconfigured by hand with valid
// information before running the installer, as otherwise we cannot get a
// valid database connection object.
if (isset($install_state['settings_verified']) && !$install_state['settings_verified']) {
return array();
}
$connection = Database::getConnection();
$t = get_t();
$requirements['title'] = $t('Database 4 byte UTF-8 support');
$utf8mb4_configurable = $connection->utf8mb4IsConfigurable();
$utf8mb4_active = $connection->utf8mb4IsActive();
$utf8mb4_supported = $connection->utf8mb4IsSupported();
$driver = $connection->driver();
$documentation_url = 'https://www.drupal.org/node/2754539';
if ($utf8mb4_active) {
if ($utf8mb4_supported) {
if ($phase != 'install' && $utf8mb4_configurable && !variable_get('drupal_all_databases_are_utf8mb4', FALSE)) {
// Supported, active, and configurable, but not all database tables
// have been converted yet.
$requirements['value'] = $t('Enabled, but database tables need conversion');
$requirements['description'] = $t('Please convert all database tables to utf8mb4 prior to enabling it in settings.php. See the <a href="@url">documentation on adding 4 byte UTF-8 support</a> for more information.', array('@url' => $documentation_url));
$requirements['severity'] = REQUIREMENT_ERROR;
}
else {
// Supported, active.
$requirements['value'] = $t('Enabled');
$requirements['description'] = $t('4 byte UTF-8 for @driver is enabled.', array('@driver' => $driver));
$requirements['severity'] = REQUIREMENT_OK;
}
}
else {
// Not supported, active.
$requirements['value'] = $t('Not supported');
$requirements['description'] = $t('4 byte UTF-8 for @driver is activated, but not supported on your system. Please turn this off in settings.php, or ensure that all database-related requirements are met. See the <a href="@url">documentation on adding 4 byte UTF-8 support</a> for more information.', array('@driver' => $driver, '@url' => $documentation_url));
$requirements['severity'] = REQUIREMENT_ERROR;
}
}
else {
if ($utf8mb4_supported) {
// Supported, not active.
$requirements['value'] = $t('Not enabled');
$requirements['description'] = $t('4 byte UTF-8 for @driver is not activated, but it is supported on your system. It is recommended that you enable this to allow 4-byte UTF-8 input such as emojis, Asian symbols and mathematical symbols to be stored correctly. See the <a href="@url">documentation on adding 4 byte UTF-8 support</a> for more information.', array('@driver' => $driver, '@url' => $documentation_url));
$requirements['severity'] = REQUIREMENT_INFO;
}
else {
// Not supported, not active.
$requirements['value'] = $t('Disabled');
$requirements['description'] = $t('4 byte UTF-8 for @driver is disabled. See the <a href="@url">documentation on adding 4 byte UTF-8 support</a> for more information.', array('@driver' => $driver, '@url' => $documentation_url));
$requirements['severity'] = REQUIREMENT_INFO;
}
}
return $requirements;
}
/**
* Implements hook_install().
*/
@@ -532,6 +607,9 @@ function system_install() {
module_list(TRUE);
module_implements('', FALSE, TRUE);
// Ensure the schema versions are not based on a previous module list.
drupal_static_reset('drupal_get_schema_versions');
// Load system theme data appropriately.
system_rebuild_theme_data();
@@ -800,6 +878,7 @@ function system_schema() {
'type' => 'varchar',
'length' => 100,
'not null' => TRUE,
'binary' => TRUE,
),
'type' => array(
'description' => 'The date format type, e.g. medium.',
@@ -2803,6 +2882,16 @@ function system_update_7061(&$sandbox) {
->from($query)
->execute();
// Retrieve a list of duplicate files with the same filepath. Only the
// most-recently uploaded of these will be moved to the new {file_managed}
// table (and all references will be updated to point to it), since
// duplicate file URIs are not allowed in Drupal 7.
// Since the Drupal 6 to 7 upgrade path leaves the {files} table behind
// after it's done, custom or contributed modules which need to migrate
// file references of their own can use a similar query to determine the
// file IDs that duplicate filepaths were mapped to.
$sandbox['duplicate_filepath_fids_to_use'] = db_query("SELECT filepath, MAX(fid) FROM {files} GROUP BY filepath HAVING COUNT(*) > 1")->fetchAllKeyed();
// Initialize batch update information.
$sandbox['progress'] = 0;
$sandbox['last_vid_processed'] = -1;
@@ -2832,6 +2921,16 @@ function system_update_7061(&$sandbox) {
continue;
}
// If this file has a duplicate filepath, replace it with the
// most-recently uploaded file that has the same filepath.
if (isset($sandbox['duplicate_filepath_fids_to_use'][$file['filepath']]) && $record->fid != $sandbox['duplicate_filepath_fids_to_use'][$file['filepath']]) {
$file = db_select('files', 'f')
->fields('f', array('fid', 'uid', 'filename', 'filepath', 'filemime', 'filesize', 'status', 'timestamp'))
->condition('f.fid', $sandbox['duplicate_filepath_fids_to_use'][$file['filepath']])
->execute()
->fetchAssoc();
}
// Add in the file information from the upload table.
$file['description'] = $record->description;
$file['display'] = $record->list;
@@ -2854,7 +2953,14 @@ function system_update_7061(&$sandbox) {
// We will convert filepaths to URI using the default scheme
// and stripping off the existing file directory path.
$file['uri'] = $scheme . preg_replace('!^' . preg_quote($basename) . '!', '', $file['filepath']);
$file['uri'] = file_stream_wrapper_uri_normalize($file['uri']);
// Normalize the URI but don't call file_stream_wrapper_uri_normalize()
// directly, since that is a higher-level API function which invokes
// hooks while validating the scheme, and those will not work during
// the upgrade. Instead, use a simpler version that just assumes the
// scheme from above is already valid.
if (($file_uri_scheme = file_uri_scheme($file['uri'])) && ($file_uri_target = file_uri_target($file['uri']))) {
$file['uri'] = $file_uri_scheme . '://' . $file_uri_target;
}
unset($file['filepath']);
// Insert into the file_managed table.
// Each fid should only be stored once in file_managed.
@@ -3150,6 +3256,35 @@ function system_update_7079() {
db_change_field('file_managed', 'filesize', 'filesize', $spec);
}
/**
* Convert the 'format' column in {date_format_locale} to case sensitive varchar.
*/
function system_update_7080() {
$spec = array(
'description' => 'The date format string.',
'type' => 'varchar',
'length' => 100,
'not null' => TRUE,
'binary' => TRUE,
);
db_change_field('date_format_locale', 'format', 'format', $spec);
}
/**
* Remove the Drupal 6 default install profile if it is still in the database.
*/
function system_update_7081() {
// Sites which used the default install profile in Drupal 6 and then updated
// to Drupal 7.44 or earlier will still have a record of this install profile
// in the database that needs to be deleted.
db_delete('system')
->condition('filename', 'profiles/default/default.profile')
->condition('type', 'module')
->condition('status', 0)
->condition('schema_version', 0)
->execute();
}
/**
* @} End of "defgroup updates-7.x-extra".
* The next series of updates should start at 8000.