mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-02 00:56:08 +02:00
formats: Add getMimeType() function (#1299)
Allows getting the expected MIME type of the format's output. A corresponding MIME_TYPE constant is also defined in FormatAbstract for the format implementations to overwrite.
This commit is contained in:
parent
d1e4bd7285
commit
c8d5c85c76
7 changed files with 30 additions and 5 deletions
|
@ -25,6 +25,8 @@
|
|||
* RSS 2.0 feed that works with feed readers that don't support the extension.
|
||||
*/
|
||||
class MrssFormat extends FormatAbstract {
|
||||
const MIME_TYPE = 'application/rss+xml';
|
||||
|
||||
const ALLOWED_IMAGE_EXT = array(
|
||||
'.gif', '.jpg', '.png'
|
||||
);
|
||||
|
@ -150,7 +152,7 @@ EOD;
|
|||
|
||||
public function display(){
|
||||
$this
|
||||
->setContentType('application/rss+xml; charset=' . $this->getCharset())
|
||||
->setContentType(self::MIME_TYPE . '; charset=' . $this->getCharset())
|
||||
->callContentType();
|
||||
|
||||
return parent::display();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue