fix(Operation): getLocalFile returns false meanwhile

- plus cosmetic changes

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2024-03-21 20:40:28 +01:00 коммит произвёл backportbot[bot]
Родитель b1e842a6e8
Коммит 50c02e33f6
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -59,7 +59,7 @@ class Launcher extends QueuedJob {
$command = str_replace('%f', escapeshellarg($tmpFile), $command);
}
// with wrapping sh around the the command, we leave any redirects in tact,
// with wrapping sh around the command, we leave any redirects intact,
// but ensure that the script is not blocking Nextcloud's execution
$wrapper = 'sh -c ' . escapeshellarg($command) . ' >/dev/null &';
$this->logger->info(

Просмотреть файл

@ -172,7 +172,7 @@ class Operation implements ISpecificOperation {
}
$this->jobList->add(Launcher::class, $args);
}
} catch (NotFoundException $e) {
} catch (NotFoundException) {
}
}
@ -199,11 +199,11 @@ class Operation implements ISpecificOperation {
if ($node instanceof FileNode) {
$fullPath = $view->getLocalFile($node->getPath());
}
if ($fullPath === null) {
if (!isset($fullPath) || $fullPath === false) {
throw new InvalidArgumentException();
}
$command = str_replace('%f', escapeshellarg($fullPath), $command);
} catch (Exception $e) {
} catch (Exception) {
throw new InvalidArgumentException('Could not determine full path');
}
}
@ -212,7 +212,7 @@ class Operation implements ISpecificOperation {
$nodeID = -1;
try {
$nodeID = $node->getId();
} catch (InvalidPathException | NotFoundException $e) {
} catch (InvalidPathException | NotFoundException) {
}
$command = str_replace('%i', escapeshellarg((string)$nodeID), $command);
}