binext: allow empty exiftool path (#601)
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/653/head
parent
fb4dad9bbe
commit
a8aaece932
|
@ -264,20 +264,18 @@ class OtherController extends GenericApiController
|
|||
bool $testIfFile = true,
|
||||
bool $testIfExecutable = true
|
||||
): string {
|
||||
if ($path instanceof \Closure) {
|
||||
try {
|
||||
$path = $path();
|
||||
} catch (\Exception $e) {
|
||||
return 'test_fail:'.$e->getMessage();
|
||||
if ($testIfFile) {
|
||||
if ($path instanceof \Closure) {
|
||||
try {
|
||||
$path = $path();
|
||||
} catch (\Exception $e) {
|
||||
return 'test_fail:'.$e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!\is_string($path)) {
|
||||
return 'not_found';
|
||||
}
|
||||
|
||||
if ($testIfFile && !is_file($path)) {
|
||||
return 'not_found';
|
||||
if (!\is_string($path) || !is_file($path)) {
|
||||
return 'not_found';
|
||||
}
|
||||
}
|
||||
|
||||
if ($testIfExecutable && !is_executable($path)) {
|
||||
|
|
|
@ -33,7 +33,7 @@ class BinExt
|
|||
|
||||
if ($copy) {
|
||||
if (empty($path)) {
|
||||
throw new \Exception('binary path is empty (run occ maintenance:repair)');
|
||||
throw new \Exception('binary path is empty (run occ maintenance:repair or use system perl)');
|
||||
}
|
||||
|
||||
if (!copy($path, $target)) {
|
||||
|
|
Loading…
Reference in New Issue