From 5f9e1f1e89f8df5420fd82b5256a461de0f98604 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Wed, 9 Jan 2013 16:56:26 -0600 Subject: [PATCH] [feature/migrations] Make sure the path sent to load_migrations is a directory Prevent a lot++ of errors PHPBB3-9737 --- phpBB/includes/db/migrator.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpBB/includes/db/migrator.php b/phpBB/includes/db/migrator.php index 1042b767e8..359c34bf5d 100644 --- a/phpBB/includes/db/migrator.php +++ b/phpBB/includes/db/migrator.php @@ -139,6 +139,11 @@ class phpbb_db_migrator */ public function load_migrations($path, $check_fulfillable = true) { + if (!is_dir($path)) + { + throw new phpbb_db_migration_exception('DIRECTORY INVALID', $path); + } + $handle = opendir($path); while (($file = readdir($handle)) !== false) {