diff options
author | David King <imkingdavid@gmail.com> | 2015-05-23 20:13:23 -0400 |
---|---|---|
committer | David King <imkingdavid@gmail.com> | 2015-05-23 20:13:23 -0400 |
commit | 4ecc13af83718e26e02afc9b8516a506ca5a26e1 (patch) | |
tree | 4bedff10fcba213493348e27c3a6744ea1b1e8c9 | |
parent | 9e6f9c8a64d89f48d531c5b24d535025dd04f956 (diff) | |
download | forums-4ecc13af83718e26e02afc9b8516a506ca5a26e1.tar forums-4ecc13af83718e26e02afc9b8516a506ca5a26e1.tar.gz forums-4ecc13af83718e26e02afc9b8516a506ca5a26e1.tar.bz2 forums-4ecc13af83718e26e02afc9b8516a506ca5a26e1.tar.xz forums-4ecc13af83718e26e02afc9b8516a506ca5a26e1.zip |
[ticket/13733] Properly handle nonexistent classes as well
PHPBB3-13733
-rw-r--r-- | phpBB/phpbb/extension/base.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/phpBB/phpbb/extension/base.php b/phpBB/phpbb/extension/base.php index 8b4d747eaf..8e717e1beb 100644 --- a/phpBB/phpbb/extension/base.php +++ b/phpBB/phpbb/extension/base.php @@ -139,11 +139,21 @@ class base implements \phpbb\extension\extension_interface foreach ($migrations as $key => $migration) { - // If the class doesn't exist OR the class does not extend the migration class - // we need to skip it. - if (!class_exists($migration) || ($reflector = new \ReflectionClass($migration) && !$reflector->isSubclassOf('\phpbb\db\migration\migration'))) { - unset($migrations[$key]); + // If the class exists and is a subclass of the + // \phpbb\db\migration\migration abstract class + // we skip it. + + // Otherwise, i.e. if it doesn't exist or it is + // not an extend the abstract class, we unset it + if (class_exists($migration)) { + $reflector = new \ReflectionClass($migration); + if ($reflector->isSubclassOf('\phpbb\db\migration\migration')) { + continue; + } + } + + unset($migrations[$key]); } return $migrations; |