Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/App/InfoParser.php')
-rw-r--r--lib/private/App/InfoParser.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php
index e0ed63fc784..ef96156dfed 100644
--- a/lib/private/App/InfoParser.php
+++ b/lib/private/App/InfoParser.php
@@ -52,7 +52,7 @@ class InfoParser {
return null;
}
- if(!is_null($this->cache)) {
+ if ($this->cache !== null) {
$fileCacheKey = $file . filemtime($file);
if ($cachedValue = $this->cache->get($fileCacheKey)) {
return json_decode($cachedValue, true);
@@ -205,13 +205,25 @@ class InfoParser {
$array['settings']['personal-section'] = [$array['settings']['personal-section']];
}
- if(!is_null($this->cache)) {
+ if (isset($array['navigations']['navigation']) && $this->isNavigationItem($array['navigations']['navigation'])) {
+ $array['navigations']['navigation'] = [$array['navigations']['navigation']];
+ }
+
+ if ($this->cache !== null) {
$this->cache->set($fileCacheKey, json_encode($array));
}
return $array;
}
/**
+ * @param $data
+ * @return bool
+ */
+ private function isNavigationItem($data): bool {
+ return isset($data['name'], $data['route']);
+ }
+
+ /**
* @param \SimpleXMLElement $xml
* @return array
*/