From 8ae6dc4b2ecaa669e061aac7879435be01021c33 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 2 Jan 2011 23:28:16 +0000 Subject: #936490 by dww, fago: Fixed Update module should verify downloaded tarballs and propagate errors correctly --- includes/updater.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'includes/updater.inc') diff --git a/includes/updater.inc b/includes/updater.inc index d86040c5b..b49d5d21f 100644 --- a/includes/updater.inc +++ b/includes/updater.inc @@ -137,7 +137,7 @@ class Updater { * Path to the info file. */ public static function findInfoFile($directory) { - $info_files = file_scan_directory($directory, '/.*\.info/'); + $info_files = file_scan_directory($directory, '/.*\.info$/'); if (!$info_files) { return FALSE; } @@ -179,8 +179,11 @@ class Updater { public static function getProjectTitle($directory) { $info_file = self::findInfoFile($directory); $info = drupal_parse_info_file($info_file); - if (!$info) { - throw new UpdaterException(t('Unable to parse info file.')); + if (empty($info)) { + throw new UpdaterException(t('Unable to parse info file: %info_file.', array('%info_file' => $info_file))); + } + if (empty($info['name'])) { + throw new UpdaterException(t("The info file (%info_file) does not define a 'name' attribute.", array('%info_file' => $info_file))); } return $info['name']; } -- cgit v1.2.3