diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-09-23 21:47:47 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-10-07 20:58:22 +0200 |
commit | 67d3574bdfdc08ad5815b5034a7c2c2e35afb4c0 (patch) | |
tree | 422684c7cb62f1f0e6b709e9160d0073cbadc5ea /lib/private/legacy/app.php | |
parent | bccc4e618a58281f390b6baa88cc0b03b1e40172 (diff) | |
download | nextcloud-server-67d3574bdfdc08ad5815b5034a7c2c2e35afb4c0.tar.gz nextcloud-server-67d3574bdfdc08ad5815b5034a7c2c2e35afb4c0.zip |
Don't parse info.xml but reuse already cached app infos - fixes #25603 (#25968)
* Don't parse info.xml but reuse already cached app infos - fixes #25603
* Use === in InfoParser. Fixes test
* InfoParser should not depend on UrlGenerator - fixes issue with session being closed too early
Diffstat (limited to 'lib/private/legacy/app.php')
-rw-r--r-- | lib/private/legacy/app.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index c3d2d1d6ad4..1093f2c8814 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -47,6 +47,7 @@ * */ use OC\App\DependencyAnalyzer; +use OC\App\InfoParser; use OC\App\Platform; use OC\Installer; use OC\OCSClient; @@ -681,7 +682,7 @@ class OC_App { $file = $appPath . '/appinfo/info.xml'; } - $parser = new \OC\App\InfoParser(\OC::$server->getURLGenerator()); + $parser = new InfoParser(); $data = $parser->parse($file); if (is_array($data)) { @@ -847,6 +848,7 @@ class OC_App { $blacklist = \OC::$server->getAppManager()->getAlwaysEnabledApps(); $appList = array(); $langCode = \OC::$server->getL10N('core')->getLanguageCode(); + $urlGenerator = \OC::$server->getURLGenerator(); foreach ($installedApps as $app) { if (array_search($app, $blacklist) === false) { @@ -900,6 +902,19 @@ class OC_App { } } } + // fix documentation + if (isset($info['documentation']) && is_array($info['documentation'])) { + foreach ($info['documentation'] as $key => $url) { + // If it is not an absolute URL we assume it is a key + // i.e. admin-ldap will get converted to go.php?to=admin-ldap + if (stripos($url, 'https://') !== 0 && stripos($url, 'http://') !== 0) { + $url = $urlGenerator->linkToDocs($url); + } + + $info['documentation'][$key] = $url; + } + } + $info['version'] = OC_App::getAppVersion($app); $appList[] = $info; } |