summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-20 17:59:35 -0500
committerGitHub <noreply@github.com>2017-04-20 17:59:35 -0500
commit8a743e0359e52bdbfcfcdca781702976a6038640 (patch)
tree716096dbd64710033135bc85b40ef21ba0a12de8 /apps/files_external/lib
parentb99d2b78bd4ff1e9b513de2e5c19077cc82619a3 (diff)
parent71118214f94971af98579876401e1b8501fa7e1c (diff)
downloadnextcloud-server-8a743e0359e52bdbfcfcdca781702976a6038640.tar.gz
nextcloud-server-8a743e0359e52bdbfcfcdca781702976a6038640.zip
Merge pull request #4404 from Ardinis/master
Remove json handling for files_external:config
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/Command/Config.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/files_external/lib/Command/Config.php b/apps/files_external/lib/Command/Config.php
index 362f0a0f2b5..5df6f7ee650 100644
--- a/apps/files_external/lib/Command/Config.php
+++ b/apps/files_external/lib/Command/Config.php
@@ -91,9 +91,9 @@ class Config extends Base {
} else {
$value = $mount->getBackendOption($key);
}
- if (!is_string($value)) { // show bools and objects correctly
- $value = json_encode($value);
- }
+ if (!is_string($value) && json_decode(json_encode($value)) === $value) { // show bools and objects correctly
+ $value = json_encode($value);
+ }
$output->writeln($value);
}
@@ -105,9 +105,9 @@ class Config extends Base {
*/
protected function setOption(StorageConfig $mount, $key, $value, OutputInterface $output) {
$decoded = json_decode($value, true);
- if (!is_null($decoded)) {
- $value = $decoded;
- }
+ if (!is_null($decoded) && json_encode($decoded) === $value) {
+ $value = $decoded;
+ }
if ($key === 'mountpoint' || $key === 'mount_point') {
$mount->setMountPoint($value);
} else {