[geeklog-cvs] Geeklog-1.x/system/classes/syndication atom.feed.class.php, 1.12, 1.13 feedparserbase.class.php, 1.6, 1.7 rdf.feed.class.php, 1.7, 1.8 rss.feed.class.php, 1.13, 1.14

Michael Jervis mjervis at qs1489.pair.com
Tue Feb 19 01:49:04 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/system/classes/syndication
In directory qs1489.pair.com:/tmp/cvs-serv45377/system/classes/syndication

Modified Files:
	atom.feed.class.php feedparserbase.class.php 
	rdf.feed.class.php rss.feed.class.php 
Log Message:
Ensure that namespaces and tags injected into feeds remain unique. Ensure implementation of tag injection is consistent over all feed classes.

Index: rss.feed.class.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/classes/syndication/rss.feed.class.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** rss.feed.class.php	15 Feb 2008 19:10:28 -0000	1.13
--- rss.feed.class.php	19 Feb 2008 06:49:02 -0000	1.14
***************
*** 125,132 ****
          $xml .= "</image>\n";
        }
!       foreach( $this->extensions as $extendingTag )
!       {
!         $xml .= $extendingTag."\n";
!       }
        return $xml;
      }
--- 125,129 ----
          $xml .= "</image>\n";
        }
!       $xml .= $this->_injectExtendingTags();
        return $xml;
      }
***************
*** 392,399 ****
          $xml .= "</image>\n";
        }
!       foreach( $this->extensions as $extendingTag )
!       {
!         $xml .= $extendingTag."\n";
!       }
        return $xml;
      }
--- 389,393 ----
          $xml .= "</image>\n";
        }
!       $xml .= $this->_injectExtendingTags();
        return $xml;
      }

Index: atom.feed.class.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/classes/syndication/atom.feed.class.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** atom.feed.class.php	13 Jun 2007 06:22:48 -0000	1.12
--- atom.feed.class.php	19 Feb 2008 06:49:02 -0000	1.13
***************
*** 133,143 ****
             . "<author>\n<name>" . $this->_safeXML( $this->title ) . '</name>' . LB
             . '<email>' . $this->_safeXML( $this->sitecontact ) . "</email>\n</author>\n";
!       if( is_array( $this->extensions ) )
!       {
!         foreach( $this->extensions as $extendingTag )
!         {
!             $xml .= "$extendingTag\n";
!         }
!       }
        return $xml;
      }
--- 133,137 ----
             . "<author>\n<name>" . $this->_safeXML( $this->title ) . '</name>' . LB
             . '<email>' . $this->_safeXML( $this->sitecontact ) . "</email>\n</author>\n";
!       $xml .= $this->_injectExtendingTags();
        return $xml;
      }
***************
*** 353,363 ****
             . "<author>\n<name>" . $this->_safeXML( $this->title ) . '</name>' . LB
             . '<email>' . $this->_safeXML( $this->sitecontact ) . "</email>\n</author>\n";
!       if( is_array( $this->extensions ) )
!       {
!         foreach( $this->extensions as $extendingTag )
!         {
!             $xml .= "$extendingTag\n";
!         }
!       }
        return $xml;
      }
--- 347,351 ----
             . "<author>\n<name>" . $this->_safeXML( $this->title ) . '</name>' . LB
             . '<email>' . $this->_safeXML( $this->sitecontact ) . "</email>\n</author>\n";
!       $xml .= $this->_injectExtendingTags();
        return $xml;
      }

Index: feedparserbase.class.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/classes/syndication/feedparserbase.class.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** feedparserbase.class.php	19 Nov 2005 03:59:17 -0000	1.6
--- feedparserbase.class.php	19 Feb 2008 06:49:02 -0000	1.7
***************
*** 238,244 ****
  
        $xml .= "<title>{$this->title}</title>\n";
!       foreach( $this->extensions as $extendingTag )
        {
!         $xml .= $extendingTag."\n";
        }
        return $xml;
--- 238,255 ----
  
        $xml .= "<title>{$this->title}</title>\n";
!       $xml .= $this->_injectExtendingTags();
!       return $xml;
!     }
!     
!     /**
!       * Inject extending tags into the feed header, if needed.
!       */
!     function _injectExtendingTags()
!     {
!         $xml = '';
!         if( is_array( $this->extensions ) )
        {
!         $this->extensions = array_unique($this->extensions);
!             $xml .= implode("\n", $this->extensions);
        }
        return $xml;
***************
*** 246,251 ****
  
      /**
!       * Inject XMLNS items into the feed master element,
!       * if needed.
        */
      function _injectNamespaces()
--- 257,261 ----
  
      /**
!       * Inject XMLNS items into the feed master element, if needed.
        */
      function _injectNamespaces()
***************
*** 254,257 ****
--- 264,268 ----
          if( is_array($this->namespaces) )
          {
+             $this->namespaces = array_unique($this->namespaces);
              $xml .= implode(' ', $this->namespaces);
          }

Index: rdf.feed.class.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/classes/syndication/rdf.feed.class.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rdf.feed.class.php	7 Jun 2007 15:08:34 -0000	1.7
--- rdf.feed.class.php	19 Feb 2008 06:49:02 -0000	1.8
***************
*** 136,146 ****
          $xml .= "</image>\n";
        }
!       if( is_array( $this->extensions ) )
!       {
!         foreach( $this->extensions as $extendingTag )
!         {
!             $xml .= "$extendingTag\n";
!         }
!       }
        $xml .= "</channel>\n";
  
--- 136,140 ----
          $xml .= "</image>\n";
        }
!       $xml .= $this->_injectExtendingTags();
        $xml .= "</channel>\n";
  




More information about the geeklog-cvs mailing list