Merge pull request #9468 from owncloud/fix_logout_error_messages

better validation: cadd extra check if appinfo/info.xml exists
This commit is contained in:
Vincent Petry 2014-07-07 10:58:23 +02:00
commit 5c444c2da8
1 changed files with 4 additions and 1 deletions

View File

@ -574,7 +574,7 @@ class OC_App {
* Read all app metadata from the info.xml file * Read all app metadata from the info.xml file
* @param string $appid id of the app or the path of the info.xml file * @param string $appid id of the app or the path of the info.xml file
* @param boolean $path (optional) * @param boolean $path (optional)
* @return array * @return array|null
* @note all data is read from info.xml, not just pre-defined fields * @note all data is read from info.xml, not just pre-defined fields
*/ */
public static function getAppInfo($appid, $path = false) { public static function getAppInfo($appid, $path = false) {
@ -587,6 +587,9 @@ class OC_App {
$file = self::getAppPath($appid) . '/appinfo/info.xml'; $file = self::getAppPath($appid) . '/appinfo/info.xml';
} }
$data = array(); $data = array();
if (!file_exists($file)) {
return null;
}
$content = @file_get_contents($file); $content = @file_get_contents($file);
if (!$content) { if (!$content) {
return null; return null;