diff options
-rw-r--r-- | includes/update.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/update.inc b/includes/update.inc index 459dc0a541e..d1993e0c3ce 100644 --- a/includes/update.inc +++ b/includes/update.inc @@ -125,7 +125,11 @@ function update_prepare_d7_bootstrap() { $pdo_link = 'http://drupal.org/requirements/pdo#pecl'; } // Check that the correct driver is loaded for the database being updated. - elseif (!in_array($databases['default']['default']['driver'], PDO::getAvailableDrivers())) { + // If we have no driver information (for example, if someone tried to create + // the Drupal 7 $databases array themselves but did not do it correctly), + // this message will be confusing, so do not perform the check; instead, just + // let the database connection fail in the code that follows. + elseif (isset($databases['default']['default']['driver']) && !in_array($databases['default']['default']['driver'], PDO::getAvailableDrivers())) { $message = '<h2>A PDO database driver is required!</h2><p>You need to enable the PDO_' . strtoupper($databases['default']['default']['driver']) . ' database driver for PHP ' . DRUPAL_MINIMUM_PHP . ' or higher so that Drupal 7 can access the database.</p>'; } if ($message) { |