1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2025-04-15 19:15:43 +02:00

adapt generateSearchIndex

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
This commit is contained in:
Benjamin Brahmer 2022-08-06 11:29:46 +02:00
parent 51e6928a46
commit a66d62d1d7

View File

@ -170,16 +170,28 @@ class Item extends Entity implements IAPI, \JsonSerializable
? implode('', $this->getCategories())
: '';
$this->setSearchIndex(
mb_strtolower(
html_entity_decode(strip_tags($this->getBody())) .
html_entity_decode($this->getAuthor()) .
html_entity_decode($this->getTitle()) .
html_entity_decode($categoriesString) .
$this->getUrl(),
'UTF-8'
)
);
if (!is_null($this->getBody())) {
$stripedBody = strip_tags($this->getBody());
} else {
$stripedBody = "";
}
$input_list = array($stripedBody, $this->getAuthor(), $this->getTitle(), $categoriesString);
$search_string = "";
foreach ($input_list as $value) {
if (is_null($value)){
$search_string .= "";
} else {
html_entity_decode($value);
}
}
$search_string .= $this->getUrl();
$search_string .= 'UTF-8';
$this->setSearchIndex(mb_strtolower($search_string));
$this->setFingerprint($this->computeFingerprint());
$this->setContentHash($this->computeContentHash());
}