Author: as
Date: Mon Feb 18 16:52:15 2008
New Revision: 7403
Log:
- Fixed issue #12557: added parse support for version 0.91 and 0.92 RSS feeds
(considered as RSS2 feeds).
Modified:
trunk/Feed/ChangeLog
trunk/Feed/src/processors/rss2.php
trunk/Feed/tests/feed_test.php
Modified: trunk/Feed/ChangeLog
==============================================================================
--- trunk/Feed/ChangeLog [iso-8859-1] (original)
+++ trunk/Feed/ChangeLog [iso-8859-1] Mon Feb 18 16:52:15 2008
@@ -18,6 +18,8 @@
- The RSS1 about attribute is accessed as id through ezcFeed.
- Added support for the Content module.
- Added support for the DublinCore module.
+- Fixed issue #12557: added parse support for version 0.91 and 0.92 RSS feeds
+ (considered as RSS2 feeds).
1.0beta1 - Monday 18 December 2006
Modified: trunk/Feed/src/processors/rss2.php
==============================================================================
--- trunk/Feed/src/processors/rss2.php [iso-8859-1] (original)
+++ trunk/Feed/src/processors/rss2.php [iso-8859-1] Mon Feb 18 16:52:15 2008
@@ -608,7 +608,7 @@
{
return false;
}
- if ( $xml->documentElement->getAttribute( 'version' ) !== "2.0" )
+ if ( !in_array( $xml->documentElement->getAttribute( 'version' ),
array( '0.91', '0.92', '2.0' ) ) )
{
return false;
}
Modified: trunk/Feed/tests/feed_test.php
==============================================================================
--- trunk/Feed/tests/feed_test.php [iso-8859-1] (original)
+++ trunk/Feed/tests/feed_test.php [iso-8859-1] Mon Feb 18 16:52:15 2008
@@ -262,6 +262,22 @@
$this->assertEquals( 'The Woodsongs Old Time Radio Hour Podcast',
$feed->title->__toString() );
}
+ public function testParseRss2Version091()
+ {
+ $feed = ezcFeed::parseContent( '<?xml version="1.0"
encoding="utf-8"?><rss version="0.91"><channel><title>RSS
0.91</title><item><title>Item 0.91</title></item></channel></rss>' );
+ $this->assertEquals( 'rss2', $feed->getFeedType() );
+ $this->assertEquals( 'RSS 0.91', $feed->title->__toString() );
+ $this->assertEquals( 'Item 0.91', $feed->items[0]->title->__toString()
);
+ }
+
+ public function testParseRss2Version092()
+ {
+ $feed = ezcFeed::parseContent( '<?xml version="1.0"
encoding="utf-8"?><rss version="0.92"><channel><title>RSS
0.92</title><item><title>Item 0.92</title></item></channel></rss>' );
+ $this->assertEquals( 'rss2', $feed->getFeedType() );
+ $this->assertEquals( 'RSS 0.92', $feed->title->__toString() );
+ $this->assertEquals( 'Item 0.92', $feed->items[0]->title->__toString()
);
+ }
+
public function testCreateModuleNotSupported()
{
try
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components