From b4460563746f28f7435bf9aeef1137af8ee4ed9b Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Wed, 6 Aug 2014 16:17:47 +0100 Subject: [PATCH] =?UTF-8?q?FIX:=20Prevent=20errors=20when=20an=20extractor?= =?UTF-8?q?=20isn=E2=80=99t=20available?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this change, it would loop over all extractors that matched the file extension and attempt extraction, even if they weren’t configured. --- code/extensions/FileTextExtractable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/extensions/FileTextExtractable.php b/code/extensions/FileTextExtractable.php index 39daa22..60d4fbe 100644 --- a/code/extensions/FileTextExtractable.php +++ b/code/extensions/FileTextExtractable.php @@ -28,7 +28,7 @@ class FileTextExtractable extends DataExtension { // Determine which extractor can process this file. $extractor = FileTextExtractor::for_file($this->owner->FullPath); - if (!$extractor) return null; + if (!$extractor || !$extractor->isAvailable()) return null; $text = $extractor->getContent($this->owner->FullPath); if (!$text) return null; @@ -40,4 +40,4 @@ class FileTextExtractable extends DataExtension { } } -?> \ No newline at end of file +?>