mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
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;
|
$tempFile = $file instanceof File ? $this->getPathFromFile($file) : $file;
|
||||||
$content = $this->getClient()->tika($tempFile);
|
$content = $this->getClient()->tika($tempFile);
|
||||||
//Cleanup temp file
|
//Cleanup temp file
|
||||||
if ($tempFile instanceof File) {
|
if ($file instanceof File) {
|
||||||
unlink($tempFile);
|
unlink($tempFile);
|
||||||
}
|
}
|
||||||
return $content;
|
return $content;
|
||||||
|
@ -81,7 +81,7 @@ class TikaTextExtractor extends FileTextExtractor
|
|||||||
$command = sprintf('tika %s %s', $mode, escapeshellarg($path));
|
$command = sprintf('tika %s %s', $mode, escapeshellarg($path));
|
||||||
$code = $this->runShell($command, $output);
|
$code = $this->runShell($command, $output);
|
||||||
//Cleanup temp file
|
//Cleanup temp file
|
||||||
if ($path instanceof File) {
|
if ($file instanceof File) {
|
||||||
unlink($path);
|
unlink($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user