Skip to content

Commit 8d1f7dc

Browse files
committed
Strom \0 from document content
Apparently the text from PDFs can contain null bytes, which PostgreSQL rejects in TEXT columns, so we have to strip them
1 parent 7239a44 commit 8d1f7dc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/Platform/SQLPlatform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public function indexDocument(IIndexDocument $document): IIndex {
224224
$pdf = $parser->parseContent($content);
225225
$content = $pdf->getText();
226226
}
227-
$indexDocument->setContent($content);
227+
$indexDocument->setContent(str_replace("\0", "", $content));
228228

229229
if ($indexDocument->getId()) {
230230
$this->indexDocumentMapper->update($indexDocument);

0 commit comments

Comments
 (0)