FIX Change check for cleanup of temp files only if file is instance of File.

This commit is contained in:
Charlie Bergthaler 2019-06-26 14:30:49 +12:00 committed by Robbie Averill
parent a9270d73ad
commit 242e5a307d
2 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,7 @@ class TikaServerTextExtractor extends FileTextExtractor
$tempFile = $file instanceof File ? $this->getPathFromFile($file) : $file;
$content = $this->getClient()->tika($tempFile);
//Cleanup temp file
if ($tempFile instanceof File) {
if ($file instanceof File) {
unlink($tempFile);
}
return $content;

View File

@ -81,7 +81,7 @@ class TikaTextExtractor extends FileTextExtractor
$command = sprintf('tika %s %s', $mode, escapeshellarg($path));
$code = $this->runShell($command, $output);
//Cleanup temp file
if ($path instanceof File) {
if ($file instanceof File) {
unlink($path);
}