Skip to content

Commit

Permalink
fix: Ensure we only pass string to writeln()
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Oct 2, 2024
1 parent 6968906 commit 9b38338
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/files_external/lib/Command/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function getOption(StorageConfig $mount, $key, OutputInterface $output
if (!is_string($value) && json_decode(json_encode($value)) === $value) { // show bools and objects correctly
$value = json_encode($value);
}
$output->writeln($value);
$output->writeln((string) $value);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/Command/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ protected function configure(): void {
*/
protected function getOption(StorageConfig $mount, $key, OutputInterface $output): void {
$value = $mount->getMountOption($key);
if (!is_string($value)) { // show bools and objects correctly
if (!is_string($value) && json_decode(json_encode($value)) === $value) { // show bools and objects correctly
$value = json_encode($value);
}
$output->writeln($value);
$output->writeln((string) $value);
}

/**
Expand Down

0 comments on commit 9b38338

Please sign in to comment.