From 0663f79640ec69a4b2249db5d7c13bbaa02f51db Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 2 Apr 2026 10:16:29 +0200 Subject: [PATCH 1/2] do not call mb_convert_encoding() if encoding is unknown --- inc/inc.ClassConversionServiceTextToText.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/inc.ClassConversionServiceTextToText.php b/inc/inc.ClassConversionServiceTextToText.php index d84e0473e..f8b8dbd43 100644 --- a/inc/inc.ClassConversionServiceTextToText.php +++ b/inc/inc.ClassConversionServiceTextToText.php @@ -57,7 +57,8 @@ class SeedDMS_ConversionServiceTextToText extends SeedDMS_ConversionServiceBase $encoding = $this->detect_utf_encoding($content); // mb_detect_encoding() is not a good as detect_utf_encoding() // $encoding = mb_detect_encoding($content); - $content = mb_convert_encoding($content, 'utf8', $encoding); + if ($encoding) + $content = mb_convert_encoding($content, 'utf8', $encoding); if($target) { file_put_contents($target, $content); return true; From a60b3b2779495698c88b52643d5fd606116cecce Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sun, 5 Apr 2026 22:23:32 +0200 Subject: [PATCH 2/2] do not index document if latest content does not exist --- inc/inc.ClassFulltextService.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inc/inc.ClassFulltextService.php b/inc/inc.ClassFulltextService.php index b729a3d8a..520427363 100644 --- a/inc/inc.ClassFulltextService.php +++ b/inc/inc.ClassFulltextService.php @@ -189,9 +189,12 @@ class SeedDMS_FulltextService { * @return object indexed Document ready for passing to the indexer */ public function IndexedDocument($object, $forceupdate=false) { /* {{{ */ - if($object->isType('document')) - $nocontent = $object->getLatestContent()->getFileSize() > $this->maxsize && $this->maxsize && !$forceupdate; - else + if($object->isType('document')) { + if ($lc = $object->getLatestContent()) + $nocontent = $lc->getFileSize() > $this->maxsize && $this->maxsize && !$forceupdate; + else + $nocontent = true; + } else $nocontent = true; $convcallback = $this->getConversionWithPreviewCallback(); return new $this->services[0]['IndexedDocument']($object->getDMS(), $object, $convcallback /*$this->conversionmgr ? $this->conversionmgr : $this->converters*/, $nocontent, $this->cmdtimeout);