Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-11-19 10:28:48 +0300
committerJulius Härtl <jus@bitgrid.net>2020-11-19 10:31:24 +0300
commit9b7bdfef79c84c8899fad4837a71825dcf9c84e8 (patch)
treeee9d4550ddb37a37c5129d3df43025e38f6c921a /apps/theming/lib
parent0f1cc78389e77520e80a6790e10a403966733441 (diff)
Fix setting images through occ for theming
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r--apps/theming/lib/Command/UpdateConfig.php9
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);