diff --git a/modules/update/update.compare.inc b/modules/update/update.compare.inc index b89a40816c765507bb66676c0ca4948299b940c2..999ecc7fb0623f0f2beb94a2a414c2bf3375a45f 100644 --- a/modules/update/update.compare.inc +++ b/modules/update/update.compare.inc @@ -124,7 +124,9 @@ function _update_process_info_list(&$projects, $list, $project_type) { // project can have multiple modules or themes. $projects[$project_name] = array( 'name' => $project_name, - 'info' => $file->info, + // Only save attributes from the .info file we care about so we do not + // bloat our RAM usage needlessly. + 'info' => update_filter_project_info($file->info), 'datestamp' => $file->info['datestamp'], 'includes' => array($file->name => $file->info['name']), 'project_type' => $project_name == 'drupal' ? 'core' : $project_type, @@ -667,3 +669,28 @@ function update_project_cache($cid) { } return $projects; } + +/** + * Filter the project .info data to only save attributes we need. + * + * @param array $info + * Array of .info file data as returned by drupal_parse_info_file(). + * + * @return + * Array of .info file data we need for the Update manager. + * + * @see _update_process_info_list() + */ +function update_filter_project_info($info) { + $whitelist = array( + '_info_file_ctime', + 'datestamp', + 'major', + 'name', + 'package', + 'project', + 'project status url', + 'version', + ); + return array_intersect_key($info, drupal_map_assoc($whitelist)); +}