Ticket #32246: class-feed.php.patch
File class-feed.php.patch, 4.4 KB (added by , 9 years ago) |
---|
-
wp-includes/class-feed.php
3 3 if ( ! class_exists( 'SimplePie', false ) ) 4 4 require_once( ABSPATH . WPINC . '/class-simplepie.php' ); 5 5 6 /** 7 * WordPress Feed Cache Class 8 * 9 * Used to cache feeds using SimplePie_Cache 10 * 11 * @package WordPress 12 * @since ? 13 */ 6 14 class WP_Feed_Cache extends SimplePie_Cache { 15 7 16 /** 8 17 * Create a new SimplePie_Cache object 9 18 * 10 19 * @static 20 * @since ? 11 21 * @access public 12 22 * 13 23 * @param string $location URL location (scheme is used to determine handler). … … 20 30 } 21 31 } 22 32 33 /** 34 * WordPress Feed Cache Transient Class 35 * 36 * Used to cache feeds using SimplePie_Cache 37 * 38 * @package WordPress 39 * @since ? 40 */ 23 41 class WP_Feed_Cache_Transient { 42 43 /** 44 * Holds the transient name. 45 * 46 * @since ? 47 * @access public 48 * @var string 49 */ 24 50 public $name; 51 52 /** 53 * Holds the transient mod name. 54 * 55 * @since ? 56 * @access public 57 * @var string 58 */ 25 59 public $mod_name; 26 public $lifetime = 43200; //Default lifetime in cache of 12 hours27 60 28 61 /** 29 * Class instantiator. 62 * Cache duration in seconds. 63 * Default is 43200 seconds (12 hours). 64 * 65 * @since ? 66 * @access public 67 * @var integer 68 */ 69 public $lifetime = 43200; 70 71 /** 72 * Constructor. 73 * 74 * @since ? 75 * @access public 30 76 * 31 77 * @param string $location URL location (scheme is used to determine handler). 32 78 * @param string $filename Unique identifier for cache object. … … 49 95 } 50 96 51 97 /** 98 * Set transient. 99 * 100 * @since ? 52 101 * @access public 53 102 * 54 103 * @param SimplePie $data Data to save. … … 65 114 } 66 115 67 116 /** 117 * Get transient. 118 * 119 * @since ? 68 120 * @access public 121 * @return mixed Transient value. 69 122 */ 70 123 public function load() { 71 124 return get_transient($this->name); … … 72 125 } 73 126 74 127 /** 128 * Get mod transient. 129 * 130 * @since ? 75 131 * @access public 132 * @return mixed Transient value. 76 133 */ 77 134 public function mtime() { 78 135 return get_transient($this->mod_name); … … 79 136 } 80 137 81 138 /** 139 * Set mod transient. 140 * 141 * @since ? 82 142 * @access public 143 * @return bool False if value was not set and true if value was set. 83 144 */ 84 145 public function touch() { 85 146 return set_transient($this->mod_name, time(), $this->lifetime); … … 86 147 } 87 148 88 149 /** 150 * Delete transients. 151 * 152 * @since ? 89 153 * @access public 154 * @return true Always true. 90 155 */ 91 156 public function unlink() { 92 157 delete_transient($this->name); … … 95 160 } 96 161 } 97 162 163 /** 164 * WordPress SimplePie File Class 165 * 166 * Used for fetching remote files and reading local files. 167 * 168 * @package WordPress 169 * @since ? 170 */ 98 171 class WP_SimplePie_File extends SimplePie_File { 99 172 173 /** 174 * Constructor. 175 * 176 * @since ? 177 * @access public 178 * 179 * @param string $url Remote file URL. 180 * @param integer $timeout How long the connection should stay open in seconds. Default: 10. 181 * @param integer $redirects The number of allowed redirects. Default: 5. 182 * @param string|array $headers Array or string of headers to send with the request. Default: null. 183 * @param string $useragent User-agent value sent. Default: null. 184 * @param boolean $force_fsockopen Wheter to force oppening internet or unix domain socket connection 185 * or not. Default: false. 186 */ 100 187 public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) { 101 188 $this->url = $url; 102 189 $this->timeout = $timeout; … … 145 232 * @since 3.5.0 146 233 */ 147 234 class WP_SimplePie_Sanitize_KSES extends SimplePie_Sanitize { 235 236 /** 237 * WordPress SimplePie sanitization using KSES. 238 * 239 * Sanitizes the incoming data, to ensure that it matches the type of data expected, using KSES. 240 * 241 * @since 3.5.0 242 * @access public 243 * 244 * @param mixed $data The data that needs to be sanitized. 245 * @param integer $type The type of data that it's supposed to be. 246 * @param string $base The `xml:base` value to use when converting relative URLs to absolute ones. 247 * @return mixed Sanitized data. 248 */ 148 249 public function sanitize( $data, $type, $base = '' ) { 149 250 $data = trim( $data ); 150 251 if ( $type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML ) {