aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-10-28 08:01:22 +0100
committerJoas Schilling <coding@schilljs.com>2024-10-28 08:46:31 +0100
commit220bd3422f7bcc3e9a757dbb4b753b8954eb36b6 (patch)
tree71daed977b772ea8b4761ead7f1595813a6909d3 /lib
parent5969b4bea84f82965edb0298f274b23c678858c8 (diff)
downloadnextcloud-server-220bd3422f7bcc3e9a757dbb4b753b8954eb36b6.tar.gz
nextcloud-server-220bd3422f7bcc3e9a757dbb4b753b8954eb36b6.zip
fix(appinfo): Make sure screenshot, author and category are always arraysbugfix/exception-appscreenshot-notstring
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/App/InfoParser.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php
index d0e67b82f21..6610121f446 100644
--- a/lib/private/App/InfoParser.php
+++ b/lib/private/App/InfoParser.php
@@ -190,6 +190,17 @@ class InfoParser {
$array['dependencies']['backend'] = [$array['dependencies']['backend']];
}
+ // Ensure some fields are always arrays
+ if (isset($array['screenshot']) && !is_array($array['screenshot'])) {
+ $array['screenshot'] = [$array['screenshot']];
+ }
+ if (isset($array['author']) && !is_array($array['author'])) {
+ $array['author'] = [$array['author']];
+ }
+ if (isset($array['category']) && !is_array($array['category'])) {
+ $array['category'] = [$array['category']];
+ }
+
if ($this->cache !== null) {
$this->cache->set($fileCacheKey, json_encode($array));
}