mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
FIX: Fixes #58 We always want $content (an array) passed to implode()
This commit is contained in:
parent
0d7c507b53
commit
42cc545414
@ -109,16 +109,12 @@ class PDFTextExtractor extends FileTextExtractor
|
||||
|
||||
$path = $file instanceof File ? $this->getPathFromFile($file) : $file;
|
||||
exec(sprintf('%s %s - 2>&1', $this->bin('pdftotext'), escapeshellarg($path)), $content, $err);
|
||||
if ($err) {
|
||||
if (!is_array($err) && $err == 1) {
|
||||
// For Windows compatibility
|
||||
$err = $content;
|
||||
}
|
||||
|
||||
if ($err) {
|
||||
throw new Exception(sprintf(
|
||||
'PDFTextExtractor->getContent() failed for %s: %s',
|
||||
$path,
|
||||
implode(PHP_EOL, $err)
|
||||
implode(PHP_EOL, $content)
|
||||
));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user