binext: allow empty exiftool path (#601)

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/653/head
Varun Patil 2023-04-24 12:48:18 -07:00
parent fb4dad9bbe
commit a8aaece932
2 changed files with 11 additions and 13 deletions

View File

@ -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)) {

View File

@ -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)) {