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:
@@ -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'] .= '...';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user