FIX Change check for cleanup of temp files only if file is instance of File.
This commit is contained in:
parent
a9270d73ad
commit
242e5a307d
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue