some additional type checks

This commit is contained in:
Georg Ehrke 2014-06-06 09:41:33 +02:00
parent 498aa66648
commit a110973b3a
2 changed files with 3 additions and 3 deletions

View File

@ -521,7 +521,7 @@ class OC_App {
*/
public static function isAppDirWritable($appid) {
$path = self::getAppPath($appid);
return is_writable($path);
return ($path !== false) ? is_writable($path) : false;
}
/**
@ -544,7 +544,7 @@ class OC_App {
*/
public static function getAppVersion($appid) {
$file = self::getAppPath($appid);
return self::getAppVersionByPath($file);
return ($file !== false) ? self::getAppVersionByPath($file) : '0';
}
/**

View File

@ -173,7 +173,7 @@ class OC_Installer{
$basedir .= '/';
$basedir .= $info['id'];
if($currentDir !== null && is_writable($currentDir)) {
if($currentDir !== false && is_writable($currentDir)) {
$basedir = $currentDir;
}
if(is_dir($basedir)) {