* A PHP-Based RSS and Atom Feed Framework.
* Takes the hard work out of managing a complete RSS/Atom solution.
*
- * Copyright (c) 2004-2007, Ryan Parman and Geoffrey Sneddon
+ * Copyright (c) 2004-2008, Ryan Parman and Geoffrey Sneddon
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* POSSIBILITY OF SUCH DAMAGE.
*
* @package SimplePie
- * @version 1.1
- * @copyright 2004-2007 Ryan Parman, Geoffrey Sneddon
+ * @version 1.1.1
+ * @copyright 2004-2008 Ryan Parman, Geoffrey Sneddon
* @author Ryan Parman
* @author Geoffrey Sneddon
* @link http://simplepie.org/ SimplePie
/**
* SimplePie Version
*/
-define('SIMPLEPIE_VERSION', '1.1');
+define('SIMPLEPIE_VERSION', '1.1.1');
/**
* SimplePie Build
+ * @todo Hardcode for release (there's no need to have to call SimplePie_Misc::parse_date() only every load of simplepie.inc)
*/
-define('SIMPLEPIE_BUILD', 20080102221556);
+define('SIMPLEPIE_BUILD', 20080315205903);
+//define('SIMPLEPIE_BUILD', gmdate('YmdHis', SimplePie_Misc::parse_date(substr('$Date: 2008-03-15 15:28:23 -0700 (Sat, 15 Mar 2008) $', 7, 25)) ? SimplePie_Misc::parse_date(substr('$Date: 2008-03-15 15:28:23 -0700 (Sat, 15 Mar 2008) $', 7, 25)) : filemtime(__FILE__)));
/**
* SimplePie Website URL
*/
define('SIMPLEPIE_NAMESPACE_MEDIARSS', 'http://search.yahoo.com/mrss/');
+/**
+ * Wrong Media RSS Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG', 'http://search.yahoo.com/mrss');
+
/**
* iTunes RSS Namespace
*/
*/
function set_raw_data($data)
{
- $this->raw_data = trim($data);
+ $this->raw_data = $data;
}
/**
// Clear the memory
unset($parent);
+ // Attributes
+ $bitrate = null;
+ $channels = null;
+ $duration = null;
+ $expression = null;
+ $framerate = null;
+ $height = null;
+ $javascript = null;
+ $lang = null;
+ $length = null;
+ $medium = null;
+ $samplingrate = null;
+ $type = null;
+ $url = null;
+ $width = null;
+
+ // Elements
+ $captions = null;
+ $categories = null;
+ $copyrights = null;
+ $credits = null;
+ $description = null;
+ $hashes = null;
+ $keywords = null;
+ $player = null;
+ $ratings = null;
+ $restrictions = null;
+ $thumbnails = null;
+ $title = null;
+
// If we have media:group tags, loop through them.
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group)
{
}
}
- if (sizeof($this->data['enclosures']) == 0)
+ if (sizeof($this->data['enclosures']) == 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))
{
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
$this->data['enclosures'][] =& new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);
* (and suffix to the item permalink)
* @return mixed URL if feed exists, false otherwise
*/
- function add_to_service($item_url, $title_url = null)
+ function add_to_service($item_url, $title_url = null, $summary_url = null)
{
if ($this->get_permalink() !== null)
{
{
$return .= $this->sanitize($title_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_title());
}
+ if ($summary_url !== null && $this->get_description() !== null)
+ {
+ $return .= $this->sanitize($summary_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_description());
+ }
return $return;
}
else
function add_to_digg()
{
- return $this->add_to_service('http://digg.com/submit?phase=2&URL=');
+ return $this->add_to_service('http://digg.com/submit?url=', '&title=', '&bodytext=');
}
function add_to_furl()
curl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects);
}
-
+
+ /* Enable Digest authentication and SSL -fox */
curl_setopt($fp, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($fp, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
return $this->SimplePie_File($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen);
}
}
- // No feed fount at error correction.
- // according to http://simplepie.org/support/viewtopic.php?id=1430
- else {
- $this->success = false;
- }
}
}
else
$this->$state();
}
$this->data = '';
- if ($this->state === 'emit')
+ if ($this->state === 'emit' || $this->state === 'body')
{
return true;
}
$this->useragent = $useragent;
$this->timeout = $timeout;
$this->max_checked_feeds = $max_checked_feeds;
- $this->content_type_sniffer_class;
+ $this->content_type_sniffer_class = $content_type_sniffer_class;
}
function find($type = SIMPLEPIE_LOCATOR_ALL)
{
$namespace = SIMPLEPIE_NAMESPACE_ITUNES;
}
+
+ // Normalize the Media RSS namespaces
+ if ($namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG)
+ {
+ $namespace = SIMPLEPIE_NAMESPACE_MEDIARSS;
+ }
$cache[$string] = array($namespace, $local_name);
}
else
}
/**
- * @todo Move to using an actual HTML parser (this will allow tags to be properly stripped, and to switch between HTML and XHTML), this will also make it easier to shortern a string while preserving HTML tags
+ * @todo Move to using an actual HTML parser (this will allow tags to be properly stripped, and to switch between HTML and XHTML), this will also make it easier to shorten a string while preserving HTML tags
*/
class SimplePie_Sanitize
{