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 $testIfFile = true,
bool $testIfExecutable = true bool $testIfExecutable = true
): string { ): string {
if ($path instanceof \Closure) { if ($testIfFile) {
try { if ($path instanceof \Closure) {
$path = $path(); try {
} catch (\Exception $e) { $path = $path();
return 'test_fail:'.$e->getMessage(); } catch (\Exception $e) {
return 'test_fail:'.$e->getMessage();
}
} }
}
if (!\is_string($path)) { if (!\is_string($path) || !is_file($path)) {
return 'not_found'; return 'not_found';
} }
if ($testIfFile && !is_file($path)) {
return 'not_found';
} }
if ($testIfExecutable && !is_executable($path)) { if ($testIfExecutable && !is_executable($path)) {

View File

@ -33,7 +33,7 @@ class BinExt
if ($copy) { if ($copy) {
if (empty($path)) { 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)) { if (!copy($path, $target)) {