mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-22 17:45:40 +03:00
3ce94409ab
Also preserves other properties.
19 lines
515 B
PHP
19 lines
515 B
PHP
<?php
|
|
|
|
class PlaintextFormat extends FormatAbstract
|
|
{
|
|
const MIME_TYPE = 'text/plain';
|
|
|
|
public function stringify()
|
|
{
|
|
$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;
|
|
}
|
|
}
|