summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/App.php
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-09-23 21:47:47 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-10-07 20:58:22 +0200
commit67d3574bdfdc08ad5815b5034a7c2c2e35afb4c0 (patch)
tree422684c7cb62f1f0e6b709e9160d0073cbadc5ea /lib/private/AppFramework/App.php
parentbccc4e618a58281f390b6baa88cc0b03b1e40172 (diff)
downloadnextcloud-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/AppFramework/App.php')
-rw-r--r--lib/private/AppFramework/App.php21
1 files changed, 4 insertions, 17 deletions
diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php
index 427a850f396..e15e4a797ea 100644
--- a/lib/private/AppFramework/App.php
+++ b/lib/private/AppFramework/App.php
@@ -59,24 +59,11 @@ class App {
return $topNamespace . self::$nameSpaceCache[$appId];
}
- // first try to parse the app's appinfo/info.xml <namespace> tag
- $appPath = OC_App::getAppPath($appId);
- if ($appPath !== false) {
- $filePath = "$appPath/appinfo/info.xml";
- if (is_file($filePath)) {
- $loadEntities = libxml_disable_entity_loader(false);
- $xml = @simplexml_load_file($filePath);
- libxml_disable_entity_loader($loadEntities);
- if ($xml) {
- $result = $xml->xpath('/info/namespace');
- if ($result && count($result) > 0) {
- self::$nameSpaceCache[$appId] = trim((string) $result[0]);
- // take first namespace result
- return $topNamespace . self::$nameSpaceCache[$appId];
- }
- }
- }
+ $appInfo = \OC_App::getAppInfo($appId);
+ if (isset($appInfo['namespace'])) {
+ return $topNamespace . trim($appInfo['namespace']);
}
+
// if the tag is not found, fall back to uppercasing the first letter
self::$nameSpaceCache[$appId] = ucfirst($appId);
return $topNamespace . self::$nameSpaceCache[$appId];