diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-09-24 12:48:44 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-09-24 12:48:44 +0200 |
commit | 5a3e57c2f5e558f88fbd83010ff64632bec46123 (patch) | |
tree | 0905385663ff3b47c6cf5a2e80c73cb66435183d | |
parent | 9b652ed5d50a40a1edde0f1b8c859f49ff8248c9 (diff) | |
download | nextcloud-server-5a3e57c2f5e558f88fbd83010ff64632bec46123.tar.gz nextcloud-server-5a3e57c2f5e558f88fbd83010ff64632bec46123.zip |
encode arrays as string
-rw-r--r-- | core/command/app/checkcode.php | 3 | ||||
-rw-r--r-- | lib/private/app/codechecker/infochecker.php | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/core/command/app/checkcode.php b/core/command/app/checkcode.php index 0db9958f387..9f6e0729ce9 100644 --- a/core/command/app/checkcode.php +++ b/core/command/app/checkcode.php @@ -127,9 +127,6 @@ class CheckCode extends Command { if($value === [] || is_null($value) || $value === '') { $output->writeln("<info>Deprecated field available: $key</info>"); } else { - if(is_array($value)) { - $value = 'Array of ' . count($value) . ' element(s)'; - } $output->writeln("<info>Deprecated field available: $key => $value</info>"); } }); diff --git a/lib/private/app/codechecker/infochecker.php b/lib/private/app/codechecker/infochecker.php index 2af72ebedc3..1272707a339 100644 --- a/lib/private/app/codechecker/infochecker.php +++ b/lib/private/app/codechecker/infochecker.php @@ -39,6 +39,7 @@ class InfoChecker extends BasicEmitter { private $optionalFields = [ 'bugs', 'category', + 'dependencies', 'documentation', 'namespace', 'ocsid', @@ -51,6 +52,7 @@ class InfoChecker extends BasicEmitter { ]; private $deprecatedFields = [ 'default_enable', + 'info', 'public', 'remote', 'shipped', @@ -76,6 +78,9 @@ class InfoChecker extends BasicEmitter { $info = $this->infoParser->parse($appPath . '/appinfo/info.xml'); foreach ($info as $key => $value) { + if(is_array($value)) { + $value = json_encode($value); + } if (in_array($key, $this->mandatoryFields)) { $this->emit('InfoChecker', 'mandatoryFieldFound', [$key, $value]); continue; @@ -88,7 +93,7 @@ class InfoChecker extends BasicEmitter { if (in_array($key, $this->deprecatedFields)) { // skip empty arrays - empty arrays for remote and public are always added - if($value === []) { + if($value === '[]' && in_array($key, ['public', 'remote', 'info'])) { continue; } $this->emit('InfoChecker', 'deprecatedFieldFound', [$key, $value]); |