[ticket/15433] Fix phpbbcli can enable non-existent extension

Fix phpbbcli can enable non-existent extension

PHPBB3-15433
This commit is contained in:
hubaishan 2017-11-01 08:48:21 +03:00 committed by Marc Alexander
parent 131c264492
commit 03b3b38db1
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
2 changed files with 8 additions and 0 deletions

View file

@ -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',

View file

@ -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())