Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix setting images through occ for theming
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and backportbot[bot] committed Nov 19, 2020
commit cc0283e2b29a87163c32ee57b4785a1405bcec9c
9 changes: 5 additions & 4 deletions apps/theming/lib/Command/UpdateConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 0;
}

if (!in_array($key, self::SUPPORTED_KEYS, true)) {
if (!in_array($key, self::SUPPORTED_KEYS, true) && !in_array($key, self::SUPPORTED_IMAGE_KEYS, true)) {
$output->writeln('<error>Invalid config key provided</error>');
return 1;
}
Expand All @@ -116,11 +116,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

if (in_array($key, self::SUPPORTED_IMAGE_KEYS, true)) {
if (file_exists(__DIR__ . $value)) {
$value = __DIR__ . $value;
if (strpos($value, '/') !== 0) {
$output->writeln('<error>The image file needs to be provided as an absolute path: ' . $value . '.</error>');
return 1;
}
if (!file_exists($value)) {
$output->writeln('<error>File could not be found: ' . $value . '</error>');
$output->writeln('<error>File could not be found: ' . $value . '.</error>');
return 1;
}
$value = $this->imageManager->updateImage($key, $value);
Expand Down