diff options
Diffstat (limited to 'lib/private/AppFramework/App.php')
-rw-r--r-- | lib/private/AppFramework/App.php | 21 |
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]; |