diff --git includes/file.inc includes/file.inc index 4f7a4c3..974d264 100644 --- includes/file.inc +++ includes/file.inc @@ -2361,6 +2361,13 @@ function file_directory_temp() { // If no directory has been found default to 'files/tmp' or 'files\\tmp'. $temporary_directory = variable_get('file_public_path', conf_path() . '/files') . $path_delimiter . 'tmp'; } + else { + // Since the temporary directory may be shared amongst many different + // users and Drupal installations, restrict to a subdirectory which is + // unique to this installation of Drupal. + $temporary_directory .= $path_delimiter . 'drupal-' . substr(hash('sha256', drupal_get_hash_salt()), 0, 8); + drupal_mkdir($temporary_directory); + } // Save the path of the discovered directory. variable_set('file_temporary_path', $temporary_directory); } diff --git includes/updater.inc includes/updater.inc index b49d5d2..0092fb9 100644 --- includes/updater.inc +++ includes/updater.inc @@ -164,7 +164,9 @@ class Updater { * The name of the project. */ public static function getProjectName($directory) { - return basename($directory); + $info_file = self::findInfoFile($directory); + $info = drupal_parse_info_file($info_file); + return !empty($info['project']) ? $info['project'] : basename($directory); } /** diff --git modules/field/field.crud.inc modules/field/field.crud.inc index eda3218..27b1638 100644 --- modules/field/field.crud.inc +++ modules/field/field.crud.inc @@ -363,7 +363,11 @@ function field_read_fields($params = array(), $include_additional = array()) { $field['translatable'] = $record['translatable']; $field['deleted'] = $record['deleted']; - module_invoke_all('field_read_field', $field); + // Manually invoke since $field is passed by reference. + foreach(module_implements('field_read_field') as $module) { + $function = $module . '_field_read_field'; + $function($field); + } // Populate storage information. module_load_install($field['module']); diff --git modules/system/system.updater.inc modules/system/system.updater.inc index 92a1529..aa10e98 100644 --- modules/system/system.updater.inc +++ modules/system/system.updater.inc @@ -26,12 +26,16 @@ class ModuleUpdater extends Updater implements DrupalUpdaterInterface { */ public function getInstallDirectory() { if ($relative_path = drupal_get_path('module', $this->name)) { - $relative_path = dirname($relative_path); + $path = DRUPAL_ROOT . '/' . $relative_path; + $project_name = $this->getProjectName($path); + do { + $path = dirname($path); + } while ($this->getProjectName($path) == $project_name); } else { - $relative_path = 'sites/all/modules'; + $path = DRUPAL_ROOT . '/' . 'sites/all/modules'; } - return DRUPAL_ROOT . '/' . $relative_path; + return $path; } public function isInstalled() { diff --git modules/update/update.module modules/update/update.module index c5551e2..952e50a 100644 --- modules/update/update.module +++ modules/update/update.module @@ -294,6 +294,7 @@ function update_cron() { // the cached data for all projects, attempt to re-fetch, and trigger any // configured notifications about the new status. update_refresh(); + update_fetch_data(); _update_cron_notify(); } else {