1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-16 21:44:01 +02:00

fix: various small fixes (#3578)

This commit is contained in:
Dag
2023-07-29 00:14:30 +02:00
committed by GitHub
parent 11ce8b5dcd
commit 701fe3cfed
13 changed files with 87 additions and 39 deletions

View File

@@ -80,10 +80,15 @@ class FilterBridge extends FeedExpander
// Generate title from first 50 characters of content?
if ($this->getInput('title_from_content') && array_key_exists('content', $item)) {
$content = str_get_html($item['content']);
$pos = strpos($item['content'], ' ', 50);
$item['title'] = substr($content->plaintext, 0, $pos);
if (strlen($content->plaintext) >= $pos) {
$item['title'] .= '...';
$plaintext = $content->plaintext;
if (mb_strlen($plaintext) < 51) {
$item['title'] = $plaintext;
} else {
$pos = strpos($item['content'], ' ', 50);
$item['title'] = substr($plaintext, 0, $pos);
if (strlen($plaintext) >= $pos) {
$item['title'] .= '...';
}
}
}