WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/05/2012 02:25:25 PM (8 years ago)
Author:
ryan
Message:

Update SimplePie to 1.3.1. Props rmccue, ocean90. fixes #22321

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-simplepie.php

    r21645 r22366  
    9494 *
    9595 * @package SimplePie
    96  * @version 1.3
     96 * @version 1.3.1
    9797 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
    9898 * @author Ryan Parman
     
    111111 * SimplePie Version
    112112 */
    113 define('SIMPLEPIE_VERSION', '1.3');
     113define('SIMPLEPIE_VERSION', '1.3.1');
    114114
    115115/**
     
    697697        if (func_num_args() > 0)
    698698        {
    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            }
    700712        }
    701713    }
     
    13241336            if ($this->cache && $parsed_feed_url['scheme'] !== '')
    13251337            {
    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'));
    13271339            }
    13281340
     
    15611573                // We need to unset this so that if SimplePie::set_file() has been called that object is untouched
    15621574                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()));
    15671589                    return false;
    15681590                }
     
    15741596                        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);
    15751597                    }
    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'));
    15771599                }
    15781600                $this->feed_url = $file->url;
     
    29632985
    29642986    /**
     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    /**
    29653046     * Sorting callback for items
    29663047     *
Note: See TracChangeset for help on using the changeset viewer.