Changeset 2538
- Timestamp:
- 06/16/08 14:30:25 (2 months ago)
- Files:
-
- simplepie/simplepie.inc (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
simplepie/simplepie.inc
r2260 r2538 6 6 * Takes the hard work out of managing a complete RSS/Atom solution. 7 7 * 8 * Copyright (c) 2004-200 7, Ryan Parman and Geoffrey Sneddon8 * Copyright (c) 2004-2008, Ryan Parman and Geoffrey Sneddon 9 9 * All rights reserved. 10 10 * … … 34 34 * 35 35 * @package SimplePie 36 * @version 1.1 37 * @copyright 2004-200 7Ryan Parman, Geoffrey Sneddon36 * @version 1.1.1 37 * @copyright 2004-2008 Ryan Parman, Geoffrey Sneddon 38 38 * @author Ryan Parman 39 39 * @author Geoffrey Sneddon … … 52 52 * SimplePie Version 53 53 */ 54 define('SIMPLEPIE_VERSION', '1.1 ');54 define('SIMPLEPIE_VERSION', '1.1.1'); 55 55 56 56 /** 57 57 * SimplePie Build 58 * @todo Hardcode for release (there's no need to have to call SimplePie_Misc::parse_date() only every load of simplepie.inc) 58 59 */ 59 define('SIMPLEPIE_BUILD', 20080102221556); 60 define('SIMPLEPIE_BUILD', 20080315205903); 61 //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__))); 60 62 61 63 /** … … 311 313 */ 312 314 define('SIMPLEPIE_NAMESPACE_MEDIARSS', 'http://search.yahoo.com/mrss/'); 315 316 /** 317 * Wrong Media RSS Namespace 318 */ 319 define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG', 'http://search.yahoo.com/mrss'); 313 320 314 321 /** … … 836 843 function set_raw_data($data) 837 844 { 838 $this->raw_data = trim($data);845 $this->raw_data = $data; 839 846 } 840 847 … … 4327 4334 unset($parent); 4328 4335 4336 // Attributes 4337 $bitrate = null; 4338 $channels = null; 4339 $duration = null; 4340 $expression = null; 4341 $framerate = null; 4342 $height = null; 4343 $javascript = null; 4344 $lang = null; 4345 $length = null; 4346 $medium = null; 4347 $samplingrate = null; 4348 $type = null; 4349 $url = null; 4350 $width = null; 4351 4352 // Elements 4353 $captions = null; 4354 $categories = null; 4355 $copyrights = null; 4356 $credits = null; 4357 $description = null; 4358 $hashes = null; 4359 $keywords = null; 4360 $player = null; 4361 $ratings = null; 4362 $restrictions = null; 4363 $thumbnails = null; 4364 $title = null; 4365 4329 4366 // If we have media:group tags, loop through them. 4330 4367 foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group) … … 5458 5495 } 5459 5496 5460 if (sizeof($this->data['enclosures']) == 0 )5497 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)) 5461 5498 { 5462 5499 // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor … … 5533 5570 * @return mixed URL if feed exists, false otherwise 5534 5571 */ 5535 function add_to_service($item_url, $title_url = null )5572 function add_to_service($item_url, $title_url = null, $summary_url = null) 5536 5573 { 5537 5574 if ($this->get_permalink() !== null) … … 5542 5579 $return .= $this->sanitize($title_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_title()); 5543 5580 } 5581 if ($summary_url !== null && $this->get_description() !== null) 5582 { 5583 $return .= $this->sanitize($summary_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_description()); 5584 } 5544 5585 return $return; 5545 5586 } … … 5567 5608 function add_to_digg() 5568 5609 { 5569 return $this->add_to_service('http://digg.com/submit? phase=2&URL=');5610 return $this->add_to_service('http://digg.com/submit?url=', '&title=', '&bodytext='); 5570 5611 } 5571 5612 … … 7583 7624 curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects); 7584 7625 } 7585 7626 7627 /* Enable Digest authentication and SSL -fox */ 7586 7628 curl_setopt($fp, CURLOPT_SSL_VERIFYPEER, false); 7587 7629 curl_setopt($fp, CURLOPT_HTTPAUTH, CURLAUTH_ANY); … … 7616 7658 return $this->SimplePie_File($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); 7617 7659 } 7618 }7619 // No feed fount at error correction.7620 // according to http://simplepie.org/support/viewtopic.php?id=14307621 else {7622 $this->success = false;7623 7660 } 7624 7661 } … … 7854 7891 } 7855 7892 $this->data = ''; 7856 if ($this->state === 'emit' )7893 if ($this->state === 'emit' || $this->state === 'body') 7857 7894 { 7858 7895 return true; … … 12416 12453 $this->timeout = $timeout; 12417 12454 $this->max_checked_feeds = $max_checked_feeds; 12418 $this->content_type_sniffer_class ;12455 $this->content_type_sniffer_class = $content_type_sniffer_class; 12419 12456 } 12420 12457 … … 12909 12946 $namespace = SIMPLEPIE_NAMESPACE_ITUNES; 12910 12947 } 12948 12949 // Normalize the Media RSS namespaces 12950 if ($namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG) 12951 { 12952 $namespace = SIMPLEPIE_NAMESPACE_MEDIARSS; 12953 } 12911 12954 $cache[$string] = array($namespace, $local_name); 12912 12955 } … … 12921 12964 12922 12965 /** 12923 * @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 shorte rn a string while preserving HTML tags12966 * @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 12924 12967 */ 12925 12968 class SimplePie_Sanitize