[Pkg-owncloud-commits] [owncloud] 108/122: Check return value of OC_App::getAppPath() and verify info.xml exists.
David Prévot
taffit at moszumanska.debian.org
Sat May 9 00:00:26 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit e418ced656aa78d52c5d03206d16ef7e453d77f0
Author: Andreas Fischer <bantu at owncloud.com>
Date: Wed May 6 14:18:38 2015 +0200
Check return value of OC_App::getAppPath() and verify info.xml exists.
---
lib/private/appframework/app.php | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/lib/private/appframework/app.php b/lib/private/appframework/app.php
index ede9718..f6c1e31 100644
--- a/lib/private/appframework/app.php
+++ b/lib/private/appframework/app.php
@@ -49,19 +49,22 @@ class App {
*/
public static function buildAppNamespace($appId, $topNamespace='OCA\\') {
// first try to parse the app's appinfo/info.xml <namespace> tag
- $filePath = OC_App::getAppPath($appId) . '/appinfo/info.xml';
- $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) {
- // take first namespace result
- return $topNamespace . trim((string) $result[0]);
+ $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) {
+ // take first namespace result
+ return $topNamespace . trim((string) $result[0]);
+ }
+ }
}
}
-
// if the tag is not found, fall back to uppercasing the first letter
return $topNamespace . ucfirst($appId);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list