From f3641e5fa6173f778e5ea2a81be69bd318e60aa4 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 4 Aug 2024 23:26:35 +0300 Subject: [PATCH] server: Fix fulltext search ignoring buffers --- src/services/search/expressions/note_content_fulltext.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/search/expressions/note_content_fulltext.ts b/src/services/search/expressions/note_content_fulltext.ts index 79d9b5376..16291d617 100644 --- a/src/services/search/expressions/note_content_fulltext.ts +++ b/src/services/search/expressions/note_content_fulltext.ts @@ -86,7 +86,7 @@ class NoteContentFulltextExp extends Expression { } } - if (!content || typeof content !== "string") { + if (!content) { return; } @@ -123,7 +123,7 @@ class NoteContentFulltextExp extends Expression { return content; } - preprocessContent(content: string, type: string, mime: string) { + preprocessContent(content: string | Buffer, type: string, mime: string) { content = utils.normalize(content.toString()); if (type === 'text' && mime === 'text/html') {