Sim
Well-known member
- Affected version
- 2.1.9
I can't recall whether this has already been reported?
If you have an addon which contains CLI commands, just copying the addon files to the server will make those CLI commands appear in the list of available commands and will be executable - you don't even need to install the addon.
Can I suggest that the CLI runner class check whether an addon is installed before adding the path to the command directory map?
In
If you have an addon which contains CLI commands, just copying the addon files to the server will make those CLI commands appear in the list of available commands and will be executable - you don't even need to install the addon.
Can I suggest that the CLI runner class check whether an addon is installed before adding the path to the command directory map?
In
\XF\Cli\Runner
:
PHP:
protected function isAddOnRootDirectory(\DirectoryIterator $entry)
{
$ds = \XF::$DS;
$pathname = $entry->getPathname();
$addOnJson = "{$pathname}{$ds}addon.json";
$outputDir = "{$pathname}{$ds}_output";
$dataDir = "{$pathname}{$ds}_data";
if (file_exists($addOnJson) || file_exists($outputDir) || file_exists($dataDir))
{
// CHECK WHETHER ADDON IS INSTALLED FIRST ???
return true;
}
else
{
return false;
}
}