mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 18:14:44 +02:00
fix: various small fixes (#3578)
This commit is contained in:
parent
11ce8b5dcd
commit
701fe3cfed
13 changed files with 87 additions and 39 deletions
|
@ -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'] .= '...';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue