Changeset 22366
- Timestamp:
- 11/05/2012 02:25:25 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/SimplePie/Author.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Cache.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman … … 80 80 * @return SimplePie_Cache_Base Type of object depends on scheme of `$location` 81 81 */ 82 public static function create($location, $filename, $extension)82 public static function get_handler($location, $filename, $extension) 83 83 { 84 84 $type = explode(':', $location, 2); … … 91 91 92 92 return new SimplePie_Cache_File($location, $filename, $extension); 93 } 94 95 /** 96 * Create a new SimplePie_Cache object 97 * 98 * @deprecated Use {@see get_handler} instead 99 */ 100 public function create($location, $filename, $extension) 101 { 102 trigger_error('Cache::create() has been replaced with Cache::get_handler(). Switch to the registry system to use this.', E_USER_DEPRECATED); 103 return self::get_handler($location, $filename, $extension); 93 104 } 94 105 -
trunk/wp-includes/SimplePie/Cache/Base.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Cache/DB.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Cache/File.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Cache/Memcache.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Cache/MySQL.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Caption.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Category.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Content/Type/Sniffer.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Copyright.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Core.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Credit.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Decode/HTML/Entities.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Enclosure.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/File.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/HTTP/Parser.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/IRI.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman … … 391 391 else 392 392 { 393 trigger_error('This should never happen', E_USER_ERROR);394 die;393 // This can occur when a paragraph is accidentally parsed as a URI 394 return false; 395 395 } 396 396 } … … 825 825 { 826 826 $parsed = $this->parse_iri((string) $iri); 827 if (!$parsed) 828 { 829 return false; 830 } 827 831 828 832 $return = $this->set_scheme($parsed['scheme']) -
trunk/wp-includes/SimplePie/Item.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Locator.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman … … 73 73 $this->max_checked_feeds = $max_checked_feeds; 74 74 75 $this->dom = new DOMDocument(); 76 77 set_error_handler(array('SimplePie_Misc', 'silence_errors')); 78 $this->dom->loadHTML($this->file->body); 79 restore_error_handler(); 75 if (class_exists('DOMDocument')) 76 { 77 $this->dom = new DOMDocument(); 78 79 set_error_handler(array('SimplePie_Misc', 'silence_errors')); 80 $this->dom->loadHTML($this->file->body); 81 restore_error_handler(); 82 } 83 else 84 { 85 $this->dom = null; 86 } 80 87 } 81 88 … … 163 170 public function get_base() 164 171 { 172 if ($this->dom === null) 173 { 174 throw new SimplePie_Exception('DOMDocument not found, unable to use locator'); 175 } 165 176 $this->http_base = $this->file->url; 166 177 $this->base = $this->http_base; … … 170 181 if ($element->hasAttribute('href')) 171 182 { 172 $this->base = $this->registry->call('Misc', 'absolutize_url', array(trim($element->getAttribute('href')), $this->http_base)); 183 $base = $this->registry->call('Misc', 'absolutize_url', array(trim($element->getAttribute('href')), $this->http_base)); 184 if ($base === false) 185 { 186 continue; 187 } 188 $this->base = $base; 173 189 $this->base_location = method_exists($element, 'getLineNo') ? $element->getLineNo() : 0; 174 190 break; … … 197 213 protected function search_elements_by_tag($name, &$done, $feeds) 198 214 { 215 if ($this->dom === null) 216 { 217 throw new SimplePie_Exception('DOMDocument not found, unable to use locator'); 218 } 219 199 220 $links = $this->dom->getElementsByTagName($name); 200 221 foreach ($links as $link) … … 216 237 { 217 238 $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base)); 239 } 240 if ($href === false) 241 { 242 continue; 218 243 } 219 244 … … 239 264 public function get_links() 240 265 { 266 if ($this->dom === null) 267 { 268 throw new SimplePie_Exception('DOMDocument not found, unable to use locator'); 269 } 270 241 271 $links = $this->dom->getElementsByTagName('a'); 242 272 foreach ($links as $link) … … 255 285 { 256 286 $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base)); 287 } 288 if ($href === false) 289 { 290 continue; 257 291 } 258 292 -
trunk/wp-includes/SimplePie/Misc.php
r22169 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman … … 81 81 { 82 82 $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative); 83 if ( $iri ) 84 return $iri->get_uri(); 85 return $relative; 83 if ($iri === false) 84 { 85 return false; 86 } 87 return $iri->get_uri(); 86 88 } 87 89 -
trunk/wp-includes/SimplePie/Net/IPv6.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Parse/Date.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Parser.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman … … 279 279 if (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['base'])) 280 280 { 281 $this->xml_base[] = $this->registry->call('Misc', 'absolutize_url', array($attribs[SIMPLEPIE_NAMESPACE_XML]['base'], end($this->xml_base))); 282 $this->xml_base_explicit[] = true; 281 $base = $this->registry->call('Misc', 'absolutize_url', array($attribs[SIMPLEPIE_NAMESPACE_XML]['base'], end($this->xml_base))); 282 if ($base !== false) 283 { 284 $this->xml_base[] = $base; 285 $this->xml_base_explicit[] = true; 286 } 283 287 } 284 288 else -
trunk/wp-includes/SimplePie/Rating.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Registry.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman … … 204 204 $class = $this->get_class($type); 205 205 206 if (in_array($class, $this->legacy)) 207 { 208 switch ($type) 209 { 210 case 'Cache': 211 // For backwards compatibility with old non-static 212 // Cache::create() methods 213 if ($method === 'get_handler') 214 { 215 $result = @call_user_func_array(array($class, 'create'), $parameters); 216 return $result; 217 } 218 break; 219 } 220 } 221 206 222 $result = call_user_func_array(array($class, $method), $parameters); 207 223 return $result; -
trunk/wp-includes/SimplePie/Restriction.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/Sanitize.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman … … 303 303 { 304 304 $image_url = call_user_func($this->cache_name_function, $img->getAttribute('src')); 305 $cache = $this->registry->call('Cache', ' create', array($this->cache_location, $image_url, 'spi'));305 $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, $image_url, 'spi')); 306 306 307 307 if ($cache->load()) … … 357 357 if ($type & SIMPLEPIE_CONSTRUCT_IRI) 358 358 { 359 $data = $this->registry->call('Misc', 'absolutize_url', array($data, $base)); 359 $absolute = $this->registry->call('Misc', 'absolutize_url', array($data, $base)); 360 if ($absolute !== false) 361 { 362 $data = $absolute; 363 } 360 364 } 361 365 … … 413 417 { 414 418 $value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base)); 415 $element->setAttribute($attribute, $value); 419 if ($value !== false) 420 { 421 $element->setAttribute($attribute, $value); 422 } 416 423 } 417 424 } -
trunk/wp-includes/SimplePie/Source.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/XML/Declaration/Parser.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/SimplePie/gzdecode.php
r21644 r22366 34 34 * 35 35 * @package SimplePie 36 * @version 1.3 36 * @version 1.3.1 37 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 38 38 * @author Ryan Parman -
trunk/wp-includes/class-simplepie.php
r21645 r22366 94 94 * 95 95 * @package SimplePie 96 * @version 1.3 96 * @version 1.3.1 97 97 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 98 98 * @author Ryan Parman … … 111 111 * SimplePie Version 112 112 */ 113 define('SIMPLEPIE_VERSION', '1.3 ');113 define('SIMPLEPIE_VERSION', '1.3.1'); 114 114 115 115 /** … … 697 697 if (func_num_args() > 0) 698 698 { 699 trigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_location() directly.'); 699 $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; 700 trigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_location() directly.', $level); 701 702 $args = func_get_args(); 703 switch (count($args)) { 704 case 3: 705 $this->set_cache_duration($args[2]); 706 case 2: 707 $this->set_cache_location($args[1]); 708 case 1: 709 $this->set_feed_url($args[0]); 710 $this->init(); 711 } 700 712 } 701 713 } … … 1324 1336 if ($this->cache && $parsed_feed_url['scheme'] !== '') 1325 1337 { 1326 $cache = $this->registry->call('Cache', ' create', array($this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc'));1338 $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc')); 1327 1339 } 1328 1340 … … 1561 1573 // We need to unset this so that if SimplePie::set_file() has been called that object is untouched 1562 1574 unset($file); 1563 if (!($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds))) 1564 { 1565 $this->error = "A feed could not be found at $this->feed_url. A feed with an invalid mime type may fall victim to this error, or " . SIMPLEPIE_NAME . " was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed."; 1566 $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__)); 1575 try 1576 { 1577 if (!($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds))) 1578 { 1579 $this->error = "A feed could not be found at $this->feed_url. A feed with an invalid mime type may fall victim to this error, or " . SIMPLEPIE_NAME . " was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed."; 1580 $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__)); 1581 return false; 1582 } 1583 } 1584 catch (SimplePie_Exception $e) 1585 { 1586 // This is usually because DOMDocument doesn't exist 1587 $this->error = $e->getMessage(); 1588 $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, $e->getFile(), $e->getLine())); 1567 1589 return false; 1568 1590 } … … 1574 1596 trigger_error("$this->cache_location is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); 1575 1597 } 1576 $cache = $this->registry->call('Cache', ' create', array($this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc'));1598 $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc')); 1577 1599 } 1578 1600 $this->feed_url = $file->url; … … 2963 2985 2964 2986 /** 2987 * Set the favicon handler 2988 * 2989 * @deprecated Use your own favicon handling instead 2990 */ 2991 public function set_favicon_handler($page = false, $qs = 'i') 2992 { 2993 $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; 2994 trigger_error('Favicon handling has been removed, please use your own handling', $level); 2995 return false; 2996 } 2997 2998 /** 2999 * Get the favicon for the current feed 3000 * 3001 * @deprecated Use your own favicon handling instead 3002 */ 3003 public function get_favicon() 3004 { 3005 $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; 3006 trigger_error('Favicon handling has been removed, please use your own handling', $level); 3007 3008 if (($url = $this->get_link()) !== null) 3009 { 3010 return 'http://g.etfv.co/' . urlencode($url); 3011 } 3012 3013 return false; 3014 } 3015 3016 /** 3017 * Magic method handler 3018 * 3019 * @param string $method Method name 3020 * @param array $args Arguments to the method 3021 * @return mixed 3022 */ 3023 public function __call($method, $args) 3024 { 3025 if (strpos($method, 'subscribe_') === 0) 3026 { 3027 $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; 3028 trigger_error('subscribe_*() has been deprecated, implement the callback yourself', $level); 3029 return ''; 3030 } 3031 if ($method === 'enable_xml_dump') 3032 { 3033 $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; 3034 trigger_error('enable_xml_dump() has been deprecated, use get_raw_data() instead', $level); 3035 return false; 3036 } 3037 3038 $class = get_class($this); 3039 $trace = debug_backtrace(); 3040 $file = $trace[0]['file']; 3041 $line = $trace[0]['line']; 3042 trigger_error("Call to undefined method $class::$method() in $file on line $line", E_USER_ERROR); 3043 } 3044 3045 /** 2965 3046 * Sorting callback for items 2966 3047 *
Note: See TracChangeset
for help on using the changeset viewer.