]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check for file exists before loading app version file
authorBart Visscher <bartv@thisnet.nl>
Wed, 17 Oct 2012 12:06:25 +0000 (14:06 +0200)
committerBart Visscher <bartv@thisnet.nl>
Sat, 20 Oct 2012 21:49:55 +0000 (23:49 +0200)
lib/app.php

index 594f057709126a8bd43a469e9a00157d6e74c6ab..cb68ea3ddde73f8852e9b2a381c687361308061b 100755 (executable)
@@ -390,9 +390,8 @@ class OC_App{
         */
        public static function getAppVersion($appid) {
                $file= self::getAppPath($appid).'/appinfo/version';
-               $version=@file_get_contents($file);
-               if($version) {
-                       return trim($version);
+               if(is_file($file) && $version = trim(file_get_contents($file))) {
+                       return $version;
                }else{
                        $appData=self::getAppInfo($appid);
                        return isset($appData['version'])? $appData['version'] : '';