summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/app.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/legacy/app.php')
-rw-r--r--lib/private/legacy/app.php48
1 files changed, 17 insertions, 31 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index adf29601ac6..a475b895d9f 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -273,9 +273,17 @@ class OC_App {
$appTypes = implode(',', $appData['types']);
} else {
$appTypes = '';
+ $appData['types'] = [];
}
\OC::$server->getAppConfig()->setValue($app, 'types', $appTypes);
+
+ if (\OC::$server->getAppManager()->hasProtectedAppType($appData['types'])) {
+ $enabled = \OC::$server->getAppConfig()->getValue($app, 'enabled', 'yes');
+ if ($enabled !== 'yes' && $enabled !== 'no') {
+ \OC::$server->getAppConfig()->setValue($app, 'enabled', 'yes');
+ }
+ }
}
/**
@@ -1296,43 +1304,21 @@ class OC_App {
$data['summary'] = self::findBestL10NOption($data['summary'], $lang);
}
if ($lang && isset($data['description']) && is_array($data['description'])) {
- $data['description'] = self::findBestL10NOption($data['description'], $lang);
- }
-
- // just modify the description if it is available
- // otherwise this will create a $data element with an empty 'description'
- if (isset($data['description'])) {
- if (is_string($data['description'])) {
- // sometimes the description contains line breaks and they are then also
- // shown in this way in the app management which isn't wanted as HTML
- // manages line breaks itself
-
- // first of all we split on empty lines
- $paragraphs = preg_split("!\n[[:space:]]*\n!mu", $data['description']);
-
- $result = [];
- foreach ($paragraphs as $value) {
- // replace multiple whitespace (tabs, space, newlines) inside a paragraph
- // with a single space - also trims whitespace
- $result[] = trim(preg_replace('![[:space:]]+!mu', ' ', $value));
- }
-
- // join the single paragraphs with a empty line in between
- $data['description'] = implode("\n\n", $result);
-
- } else {
- $data['description'] = '';
- }
+ $data['description'] = trim(self::findBestL10NOption($data['description'], $lang));
+ } else if (isset($data['description']) && is_string($data['description'])) {
+ $data['description'] = trim($data['description']);
+ } else {
+ $data['description'] = '';
}
return $data;
}
/**
- * @param $config
- * @param $l
- * @param $info
- * @throws Exception
+ * @param \OCP\IConfig $config
+ * @param \OCP\IL10N $l
+ * @param array $info
+ * @throws \Exception
*/
protected static function checkAppDependencies($config, $l, $info) {
$dependencyAnalyzer = new DependencyAnalyzer(new Platform($config), $l);