fix some scrutinizer "bugs"

This commit is contained in:
Ralf Becker 2016-06-26 19:28:33 +02:00
parent d11405205c
commit ada94b8d43

View File

@ -1620,7 +1620,7 @@ class Vfs extends Vfs\StreamWrapper
{ {
// we require write rights to lock/unlock a resource // we require write rights to lock/unlock a resource
if (!$path || $update && !$token || $check_writable && if (!$path || $update && !$token || $check_writable &&
!(self::is_writable($path) || !self::file_exists($path) && self::is_writable(self::dirname($path)))) !(self::is_writable($path) || !self::file_exists($path) && ($dir=self::dirname($path)) && self::is_writable($dir)))
{ {
return false; return false;
} }
@ -2050,7 +2050,7 @@ class Vfs extends Vfs\StreamWrapper
if (self::LOG_LEVEL) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).",$check_is_uploaded_file) returning FALSE !is_uploaded_file()"); if (self::LOG_LEVEL) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).",$check_is_uploaded_file) returning FALSE !is_uploaded_file()");
return false; return false;
} }
if (!(self::is_writable($target) || self::is_writable(self::dirname($target)))) if (!(self::is_writable($target) || ($dir = self::dirname($target)) && self::is_writable($dir)))
{ {
if (self::LOG_LEVEL) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).",$check_is_uploaded_file) returning FALSE !writable"); if (self::LOG_LEVEL) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).",$check_is_uploaded_file) returning FALSE !writable");
return false; return false;