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,6 +264,7 @@ class OtherController extends GenericApiController
bool $testIfFile = true, bool $testIfFile = true,
bool $testIfExecutable = true bool $testIfExecutable = true
): string { ): string {
if ($testIfFile) {
if ($path instanceof \Closure) { if ($path instanceof \Closure) {
try { try {
$path = $path(); $path = $path();
@ -272,12 +273,9 @@ class OtherController extends GenericApiController
} }
} }
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)) {