mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-06 16:46:30 +02:00
refactor: format rendering (#4229)
This commit is contained in:
@@ -4,16 +4,13 @@ class PlaintextFormat extends FormatAbstract
|
||||
{
|
||||
const MIME_TYPE = 'text/plain';
|
||||
|
||||
public function stringify()
|
||||
public function render(): string
|
||||
{
|
||||
$feed = $this->getFeed();
|
||||
foreach ($this->getItems() as $item) {
|
||||
$feed['items'][] = $item->toArray();
|
||||
}
|
||||
$text = print_r($feed, true);
|
||||
// Remove invalid non-UTF8 characters
|
||||
ini_set('mbstring.substitute_character', 'none');
|
||||
$text = mb_convert_encoding($text, $this->getCharset(), 'UTF-8');
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user