Skip to content

Commit

Permalink
Merge pull request #4404 from Ardinis/master
Browse files Browse the repository at this point in the history
Remove json handling for files_external:config
  • Loading branch information
MorrisJobke authored Apr 20, 2017
2 parents b99d2b7 + 7111821 commit 8a743e0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/files_external/lib/Command/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ protected function getOption(StorageConfig $mount, $key, OutputInterface $output
} 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);
}

Expand All @@ -105,9 +105,9 @@ protected function getOption(StorageConfig $mount, $key, OutputInterface $output
*/
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 {
Expand Down

0 comments on commit 8a743e0

Please sign in to comment.