diff --git a/model.php b/model.php index 0dbdb25..95bb023 100644 --- a/model.php +++ b/model.php @@ -574,8 +574,7 @@ function save_config(array $values) \PicoTools\Translator\load($values['language']); // If the user does not want content of feeds, remove it in previous ones - if ((bool) $values['nocontent']) { - + if (isset($values['nocontent']) && (bool) $values['nocontent']) { \PicoTools\singleton('db')->table('items')->update(array('content' => '')); } diff --git a/vendor/PicoFeed/Writers/Atom.php b/vendor/PicoFeed/Writers/Atom.php index 5609293..4516440 100644 --- a/vendor/PicoFeed/Writers/Atom.php +++ b/vendor/PicoFeed/Writers/Atom.php @@ -31,7 +31,7 @@ class Atom extends \PicoFeed\Writer // $generator = $this->dom->createElement('generator', 'PicoFeed'); - $generator->setAttribute('url', 'https://github.com/fguillot/picoFeed'); + $generator->setAttribute('uri', 'https://github.com/fguillot/picoFeed'); $feed->appendChild($generator); // diff --git a/vendor/PicoFeed/Writers/Rss20.php b/vendor/PicoFeed/Writers/Rss20.php index ee3d233..ec17ce4 100644 --- a/vendor/PicoFeed/Writers/Rss20.php +++ b/vendor/PicoFeed/Writers/Rss20.php @@ -9,6 +9,7 @@ class Rss20 extends \PicoFeed\Writer private $required_feed_properties = array( 'title', 'site_url', + 'feed_url', ); private $required_item_properties = array( @@ -28,6 +29,7 @@ class Rss20 extends \PicoFeed\Writer $rss = $this->dom->createElement('rss'); $rss->setAttribute('version', '2.0'); $rss->setAttributeNodeNS(new \DomAttr('xmlns:content', 'http://purl.org/rss/1.0/modules/content/')); + $rss->setAttributeNodeNS(new \DomAttr('xmlns:atom', 'http://www.w3.org/2005/Atom')); $channel = $this->dom->createElement('channel'); @@ -44,6 +46,13 @@ class Rss20 extends \PicoFeed\Writer // <pubDate/> $this->addPubDate($channel, isset($this->updated) ? $this->updated : ''); + // <atom:link/> + $link = $this->dom->createElement('atom:link'); + $link->setAttribute('href', $this->feed_url); + $link->setAttribute('rel', 'self'); + $link->setAttribute('type', 'application/rss+xml'); + $channel->appendChild($link); + // <link/> $channel->appendChild($this->dom->createElement('link', $this->site_url)); @@ -55,7 +64,7 @@ class Rss20 extends \PicoFeed\Writer $this->checkRequiredProperties($this->required_item_properties, $item); - $entry = $this->dom->createElement('entry'); + $entry = $this->dom->createElement('item'); // <title/> $entry->appendChild($this->dom->createElement('title', $item['title']));