ZF-10954: Identifier returned by Zend_Feed_Reader_Entry_Rss::getID() is not unique

Issue Type: Bug Created: 2011-01-15T22:28:27.000+0000 Last Updated: 2011-01-15T22:31:03.000+0000 Status: Open Fix version(s): Reporter: Filipus Klutiero (chealer) Assignee: Pádraic Brady (padraic) Tags: - Zend_Feed_Reader

Related issues: Attachments:


According to documentation, Zend_Feed_Reader_Entry_Rss::getID() "Returns a unique ID for the current entry.":…

In fact, the identifier is not necessarily unique. The method tries to obtain a uid from several of the item's fields:

 * Get the entry ID
 * @return string
public function getId()
    if (array_key_exists('id', $this->_data)) {
        return $this->_data['id'];

    $id = null;

    if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
        && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090
    ) {
        $id = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/guid)');

    if (!$id) {
        $id = $this->getExtension('DublinCore')->getId();

    if (empty($id)) {
        $id = $this->getExtension('Atom')->getId();

    if (!$id) {
        if ($this->getPermalink()) {
            $id = $this->getPermalink();
        } elseif ($this->getTitle()) {
            $id = $this->getTitle();
        } else {
            $id = null;

    $this->_data['id'] = $id;

    return $this->_data['id'];

For a RSS 2 feed without guid, getPermalink() (which uses the link element) is a fallback. As my test case feed shows, two items can have the same value for link. This causes 2 items to have the same return value for getId().


Posted by Filipus Klutiero (chealer) on 2011-01-15T22:30:59.000+0000

Here is the test case feed: Project Summary: Tiki Wiki CMS Groupware (tikiwiki project) A summary of key project details for the tikiwiki project on and acceptable use information for this RSS feed may be found at: Sun, 16 Jan 2011 04:48:42 RSS generatorDownloadable files: 902745 total downloads to dateMost recent daily statistics (16 Jan 2011): Download count: 167[…]( Sun, 16 Jan 2011 04:48:42 GMTDownloadable files: 900000 total downloads to dateMost recent daily statistics (14 Jan 2011): Download count: 150[…]( Sun, 16 Jan 2011 00:48:42 GMT

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.