Skip to content

Commit 095e349

Browse files
BlackbitDevsJan Walther
andauthored
Remove base64 asset data when indexing wysiwyg fields (#288)
* remove base64 asset data when indexing wysiwyg fields * remove base64 asset data when indexing wysiwyg fields * remove base64 asset data when indexing wysiwyg fields --------- Co-authored-by: Jan Walther <jan.walther@blackbit.de>
1 parent f76d347 commit 095e349

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/TextKeywordAdapter.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,13 @@ public function getIndexMapping(): array
3939
$this->searchIndexConfigService->getSearchAnalyzerAttributes()
4040
);
4141
}
42+
43+
public function normalize(mixed $value): ?string
44+
{
45+
if ($value) {
46+
return preg_replace("/src=['\"]data:[^;]+;base64,.+?['\"]/", '', $value);
47+
}
48+
49+
return null;
50+
}
4251
}

0 commit comments

Comments
 (0)