diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-11-20 10:04:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-20 10:04:16 +0100 |
commit | b5d99fdc679d7640086282426c60a329e31e07a0 (patch) | |
tree | d20a207a2b6f96909f50118f9e64762f156a76e9 | |
parent | b97416ee6274c1637210b8c495b83bc290b57f2b (diff) | |
parent | cc0283e2b29a87163c32ee57b4785a1405bcec9c (diff) | |
download | nextcloud-server-b5d99fdc679d7640086282426c60a329e31e07a0.tar.gz nextcloud-server-b5d99fdc679d7640086282426c60a329e31e07a0.zip |
Merge pull request #24233 from nextcloud/backport/24211/stable19
[stable19] Fix setting images through occ for theming
-rw-r--r-- | apps/theming/lib/Command/UpdateConfig.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/theming/lib/Command/UpdateConfig.php b/apps/theming/lib/Command/UpdateConfig.php index 7d616879dc6..849744077ef 100644 --- a/apps/theming/lib/Command/UpdateConfig.php +++ b/apps/theming/lib/Command/UpdateConfig.php @@ -94,7 +94,7 @@ class UpdateConfig extends Command { 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; } @@ -116,11 +116,12 @@ class UpdateConfig extends Command { } 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); |