From 8cc5f17b58e60c236bacfd077fb431ab03eab565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Tue, 15 Jan 2008 10:59:03 +0000 Subject: #190729 by aufumy, Pasqualle, slightly modified: report incompatibility early, if the dependencies key is not an array in the .info file --- modules/system/system.admin.inc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules') diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 75f3dcbe3..ef99085d8 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -576,6 +576,14 @@ function _system_is_incompatible(&$incompatible, $files, $file) { if (isset($incompatible[$file->name])) { return TRUE; } + // The 'dependencies' key in .info files was a string in Drupal 5, but changed + // to an array in Drupal 6. If it is not an array, the module is not + // compatible and we can skip the check below which requires an array. + if (!is_array($file->info['dependencies'])) { + $file->info['dependencies'] = array(); + $incompatible[$file->name] = TRUE; + return TRUE; + } // Recursively traverse the dependencies, looking for incompatible modules foreach ($file->info['dependencies'] as $dependency) { if (isset($files[$dependency]) && _system_is_incompatible($incompatible, $files, $files[$dependency])) { -- cgit v1.2.3