open_basedir로 제한되어 있는 경우 ffmpeg 기능을 사용할 수 없는 문제 수정

This commit is contained in:
conory 2019-10-10 18:44:45 +09:00
parent ca8204a4c0
commit c10e4c082b

View file

@ -152,7 +152,22 @@ class Storage
public static function isExecutable($path)
{
$path = rtrim($path, '/\\');
return @self::exists($path) && @is_executable($path);
if (function_exists('exec'))
{
@exec('/bin/ls -l ' . escapeshellarg($path), $output, $return_var);
if ($return_var === 0)
{
return preg_match('@^[a-z-]{9}x@', array_pop($output)) === 1;
}
else
{
return false;
}
}
else
{
return @self::exists($path) && @is_executable($path);
}
}
/**