diff options
author | hubaishan <saeed@hubaishan.com> | 2017-11-01 08:48:21 +0300 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2017-12-03 15:01:31 +0100 |
commit | 03b3b38db17c5fc554f54aed3f3fc1941279a04e (patch) | |
tree | 349112957459e472594d0ca719765edb7638a4c3 | |
parent | 131c26449228221f0028711e41ab79191ab2c25a (diff) | |
download | forums-03b3b38db17c5fc554f54aed3f3fc1941279a04e.tar forums-03b3b38db17c5fc554f54aed3f3fc1941279a04e.tar.gz forums-03b3b38db17c5fc554f54aed3f3fc1941279a04e.tar.bz2 forums-03b3b38db17c5fc554f54aed3f3fc1941279a04e.tar.xz forums-03b3b38db17c5fc554f54aed3f3fc1941279a04e.zip |
[ticket/15433] Fix phpbbcli can enable non-existent extension
Fix phpbbcli can enable non-existent extension
PHPBB3-15433
-rw-r--r-- | phpBB/language/en/cli.php | 1 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/extension/enable.php | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php index 1655855edb..505d12e8ff 100644 --- a/phpBB/language/en/cli.php +++ b/phpBB/language/en/cli.php @@ -117,6 +117,7 @@ $lang = array_merge($lang, array( 'CLI_EXTENSION_ENABLE_FAILURE' => 'Could not enable extension %s', 'CLI_EXTENSION_ENABLE_SUCCESS' => 'Successfully enabled extension %s', 'CLI_EXTENSION_ENABLED' => 'Extension %s is already enabled', + 'CLI_EXTENSION_NOT_EXIST' => 'Extension %s does not exist', 'CLI_EXTENSION_NAME' => 'Name of the extension', 'CLI_EXTENSION_PURGE_FAILURE' => 'Could not purge extension %s', 'CLI_EXTENSION_PURGE_SUCCESS' => 'Successfully purged extension %s', diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index f92de0069c..a6f5b10e86 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -37,6 +37,13 @@ class enable extends command $io = new SymfonyStyle($input, $output); $name = $input->getArgument('extension-name'); + + if (!$this->manager->is_available($name)) + { + $io->error($this->user->lang('CLI_EXTENSION_NOT_EXIST', $name)); + return 1; + } + $extension = $this->manager->get_extension($name); if (!$extension->is_enableable()) |