Edit File by line
/home/barbar84/public_h.../wp-inclu...
File: rss.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* MagpieRSS: a simple RSS integration tool
[2] Fix | Delete
*
[3] Fix | Delete
* A compiled file for RSS syndication
[4] Fix | Delete
*
[5] Fix | Delete
* @author Kellan Elliott-McCrea <kellan@protest.net>
[6] Fix | Delete
* @version 0.51
[7] Fix | Delete
* @license GPL
[8] Fix | Delete
*
[9] Fix | Delete
* @package External
[10] Fix | Delete
* @subpackage MagpieRSS
[11] Fix | Delete
* @deprecated 3.0.0 Use SimplePie instead.
[12] Fix | Delete
*/
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* Deprecated. Use SimplePie (class-simplepie.php) instead.
[16] Fix | Delete
*/
[17] Fix | Delete
_deprecated_file( basename( __FILE__ ), '3.0.0', WPINC . '/class-simplepie.php' );
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* Fires before MagpieRSS is loaded, to optionally replace it.
[21] Fix | Delete
*
[22] Fix | Delete
* @since 2.3.0
[23] Fix | Delete
* @deprecated 3.0.0
[24] Fix | Delete
*/
[25] Fix | Delete
do_action( 'load_feed_engine' );
[26] Fix | Delete
[27] Fix | Delete
/** RSS feed constant. */
[28] Fix | Delete
define('RSS', 'RSS');
[29] Fix | Delete
define('ATOM', 'Atom');
[30] Fix | Delete
define('MAGPIE_USER_AGENT', 'WordPress/' . $GLOBALS['wp_version']);
[31] Fix | Delete
[32] Fix | Delete
class MagpieRSS {
[33] Fix | Delete
var $parser;
[34] Fix | Delete
var $current_item = array(); // item currently being parsed
[35] Fix | Delete
var $items = array(); // collection of parsed items
[36] Fix | Delete
var $channel = array(); // hash of channel fields
[37] Fix | Delete
var $textinput = array();
[38] Fix | Delete
var $image = array();
[39] Fix | Delete
var $feed_type;
[40] Fix | Delete
var $feed_version;
[41] Fix | Delete
[42] Fix | Delete
// parser variables
[43] Fix | Delete
var $stack = array(); // parser stack
[44] Fix | Delete
var $inchannel = false;
[45] Fix | Delete
var $initem = false;
[46] Fix | Delete
var $incontent = false; // if in Atom <content mode="xml"> field
[47] Fix | Delete
var $intextinput = false;
[48] Fix | Delete
var $inimage = false;
[49] Fix | Delete
var $current_field = '';
[50] Fix | Delete
var $current_namespace = false;
[51] Fix | Delete
[52] Fix | Delete
//var $ERROR = "";
[53] Fix | Delete
[54] Fix | Delete
var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* PHP5 constructor.
[58] Fix | Delete
*/
[59] Fix | Delete
function __construct( $source ) {
[60] Fix | Delete
[61] Fix | Delete
# Check if PHP xml isn't compiled
[62] Fix | Delete
#
[63] Fix | Delete
if ( ! function_exists('xml_parser_create') ) {
[64] Fix | Delete
return trigger_error( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." );
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
$parser = xml_parser_create();
[68] Fix | Delete
[69] Fix | Delete
$this->parser = $parser;
[70] Fix | Delete
[71] Fix | Delete
# pass in parser, and a reference to this object
[72] Fix | Delete
# set up handlers
[73] Fix | Delete
#
[74] Fix | Delete
xml_set_object( $this->parser, $this );
[75] Fix | Delete
xml_set_element_handler($this->parser,
[76] Fix | Delete
'feed_start_element', 'feed_end_element' );
[77] Fix | Delete
[78] Fix | Delete
xml_set_character_data_handler( $this->parser, 'feed_cdata' );
[79] Fix | Delete
[80] Fix | Delete
$status = xml_parse( $this->parser, $source );
[81] Fix | Delete
[82] Fix | Delete
if (! $status ) {
[83] Fix | Delete
$errorcode = xml_get_error_code( $this->parser );
[84] Fix | Delete
if ( $errorcode != XML_ERROR_NONE ) {
[85] Fix | Delete
$xml_error = xml_error_string( $errorcode );
[86] Fix | Delete
$error_line = xml_get_current_line_number($this->parser);
[87] Fix | Delete
$error_col = xml_get_current_column_number($this->parser);
[88] Fix | Delete
$errormsg = "$xml_error at line $error_line, column $error_col";
[89] Fix | Delete
[90] Fix | Delete
$this->error( $errormsg );
[91] Fix | Delete
}
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
xml_parser_free( $this->parser );
[95] Fix | Delete
unset( $this->parser );
[96] Fix | Delete
[97] Fix | Delete
$this->normalize();
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
/**
[101] Fix | Delete
* PHP4 constructor.
[102] Fix | Delete
*/
[103] Fix | Delete
public function MagpieRSS( $source ) {
[104] Fix | Delete
self::__construct( $source );
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
function feed_start_element($p, $element, &$attrs) {
[108] Fix | Delete
$el = $element = strtolower($element);
[109] Fix | Delete
$attrs = array_change_key_case($attrs, CASE_LOWER);
[110] Fix | Delete
[111] Fix | Delete
// check for a namespace, and split if found
[112] Fix | Delete
$ns = false;
[113] Fix | Delete
if ( strpos( $element, ':' ) ) {
[114] Fix | Delete
list($ns, $el) = explode( ':', $element, 2);
[115] Fix | Delete
}
[116] Fix | Delete
if ( $ns and $ns != 'rdf' ) {
[117] Fix | Delete
$this->current_namespace = $ns;
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
# if feed type isn't set, then this is first element of feed
[121] Fix | Delete
# identify feed from root element
[122] Fix | Delete
#
[123] Fix | Delete
if (!isset($this->feed_type) ) {
[124] Fix | Delete
if ( $el == 'rdf' ) {
[125] Fix | Delete
$this->feed_type = RSS;
[126] Fix | Delete
$this->feed_version = '1.0';
[127] Fix | Delete
}
[128] Fix | Delete
elseif ( $el == 'rss' ) {
[129] Fix | Delete
$this->feed_type = RSS;
[130] Fix | Delete
$this->feed_version = $attrs['version'];
[131] Fix | Delete
}
[132] Fix | Delete
elseif ( $el == 'feed' ) {
[133] Fix | Delete
$this->feed_type = ATOM;
[134] Fix | Delete
$this->feed_version = $attrs['version'];
[135] Fix | Delete
$this->inchannel = true;
[136] Fix | Delete
}
[137] Fix | Delete
return;
[138] Fix | Delete
}
[139] Fix | Delete
[140] Fix | Delete
if ( $el == 'channel' )
[141] Fix | Delete
{
[142] Fix | Delete
$this->inchannel = true;
[143] Fix | Delete
}
[144] Fix | Delete
elseif ($el == 'item' or $el == 'entry' )
[145] Fix | Delete
{
[146] Fix | Delete
$this->initem = true;
[147] Fix | Delete
if ( isset($attrs['rdf:about']) ) {
[148] Fix | Delete
$this->current_item['about'] = $attrs['rdf:about'];
[149] Fix | Delete
}
[150] Fix | Delete
}
[151] Fix | Delete
[152] Fix | Delete
// if we're in the default namespace of an RSS feed,
[153] Fix | Delete
// record textinput or image fields
[154] Fix | Delete
elseif (
[155] Fix | Delete
$this->feed_type == RSS and
[156] Fix | Delete
$this->current_namespace == '' and
[157] Fix | Delete
$el == 'textinput' )
[158] Fix | Delete
{
[159] Fix | Delete
$this->intextinput = true;
[160] Fix | Delete
}
[161] Fix | Delete
[162] Fix | Delete
elseif (
[163] Fix | Delete
$this->feed_type == RSS and
[164] Fix | Delete
$this->current_namespace == '' and
[165] Fix | Delete
$el == 'image' )
[166] Fix | Delete
{
[167] Fix | Delete
$this->inimage = true;
[168] Fix | Delete
}
[169] Fix | Delete
[170] Fix | Delete
# handle atom content constructs
[171] Fix | Delete
elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
[172] Fix | Delete
{
[173] Fix | Delete
// avoid clashing w/ RSS mod_content
[174] Fix | Delete
if ($el == 'content' ) {
[175] Fix | Delete
$el = 'atom_content';
[176] Fix | Delete
}
[177] Fix | Delete
[178] Fix | Delete
$this->incontent = $el;
[179] Fix | Delete
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
// if inside an Atom content construct (e.g. content or summary) field treat tags as text
[183] Fix | Delete
elseif ($this->feed_type == ATOM and $this->incontent )
[184] Fix | Delete
{
[185] Fix | Delete
// if tags are inlined, then flatten
[186] Fix | Delete
$attrs_str = join(' ',
[187] Fix | Delete
array_map(array('MagpieRSS', 'map_attrs'),
[188] Fix | Delete
array_keys($attrs),
[189] Fix | Delete
array_values($attrs) ) );
[190] Fix | Delete
[191] Fix | Delete
$this->append_content( "<$element $attrs_str>" );
[192] Fix | Delete
[193] Fix | Delete
array_unshift( $this->stack, $el );
[194] Fix | Delete
}
[195] Fix | Delete
[196] Fix | Delete
// Atom support many links per containging element.
[197] Fix | Delete
// Magpie treats link elements of type rel='alternate'
[198] Fix | Delete
// as being equivalent to RSS's simple link element.
[199] Fix | Delete
//
[200] Fix | Delete
elseif ($this->feed_type == ATOM and $el == 'link' )
[201] Fix | Delete
{
[202] Fix | Delete
if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
[203] Fix | Delete
{
[204] Fix | Delete
$link_el = 'link';
[205] Fix | Delete
}
[206] Fix | Delete
else {
[207] Fix | Delete
$link_el = 'link_' . $attrs['rel'];
[208] Fix | Delete
}
[209] Fix | Delete
[210] Fix | Delete
$this->append($link_el, $attrs['href']);
[211] Fix | Delete
}
[212] Fix | Delete
// set stack[0] to current element
[213] Fix | Delete
else {
[214] Fix | Delete
array_unshift($this->stack, $el);
[215] Fix | Delete
}
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
function feed_cdata ($p, $text) {
[219] Fix | Delete
[220] Fix | Delete
if ($this->feed_type == ATOM and $this->incontent)
[221] Fix | Delete
{
[222] Fix | Delete
$this->append_content( $text );
[223] Fix | Delete
}
[224] Fix | Delete
else {
[225] Fix | Delete
$current_el = join('_', array_reverse($this->stack));
[226] Fix | Delete
$this->append($current_el, $text);
[227] Fix | Delete
}
[228] Fix | Delete
}
[229] Fix | Delete
[230] Fix | Delete
function feed_end_element ($p, $el) {
[231] Fix | Delete
$el = strtolower($el);
[232] Fix | Delete
[233] Fix | Delete
if ( $el == 'item' or $el == 'entry' )
[234] Fix | Delete
{
[235] Fix | Delete
$this->items[] = $this->current_item;
[236] Fix | Delete
$this->current_item = array();
[237] Fix | Delete
$this->initem = false;
[238] Fix | Delete
}
[239] Fix | Delete
elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
[240] Fix | Delete
{
[241] Fix | Delete
$this->intextinput = false;
[242] Fix | Delete
}
[243] Fix | Delete
elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
[244] Fix | Delete
{
[245] Fix | Delete
$this->inimage = false;
[246] Fix | Delete
}
[247] Fix | Delete
elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
[248] Fix | Delete
{
[249] Fix | Delete
$this->incontent = false;
[250] Fix | Delete
}
[251] Fix | Delete
elseif ($el == 'channel' or $el == 'feed' )
[252] Fix | Delete
{
[253] Fix | Delete
$this->inchannel = false;
[254] Fix | Delete
}
[255] Fix | Delete
elseif ($this->feed_type == ATOM and $this->incontent ) {
[256] Fix | Delete
// balance tags properly
[257] Fix | Delete
// note: This may not actually be necessary
[258] Fix | Delete
if ( $this->stack[0] == $el )
[259] Fix | Delete
{
[260] Fix | Delete
$this->append_content("</$el>");
[261] Fix | Delete
}
[262] Fix | Delete
else {
[263] Fix | Delete
$this->append_content("<$el />");
[264] Fix | Delete
}
[265] Fix | Delete
[266] Fix | Delete
array_shift( $this->stack );
[267] Fix | Delete
}
[268] Fix | Delete
else {
[269] Fix | Delete
array_shift( $this->stack );
[270] Fix | Delete
}
[271] Fix | Delete
[272] Fix | Delete
$this->current_namespace = false;
[273] Fix | Delete
}
[274] Fix | Delete
[275] Fix | Delete
function concat (&$str1, $str2="") {
[276] Fix | Delete
if (!isset($str1) ) {
[277] Fix | Delete
$str1="";
[278] Fix | Delete
}
[279] Fix | Delete
$str1 .= $str2;
[280] Fix | Delete
}
[281] Fix | Delete
[282] Fix | Delete
function append_content($text) {
[283] Fix | Delete
if ( $this->initem ) {
[284] Fix | Delete
$this->concat( $this->current_item[ $this->incontent ], $text );
[285] Fix | Delete
}
[286] Fix | Delete
elseif ( $this->inchannel ) {
[287] Fix | Delete
$this->concat( $this->channel[ $this->incontent ], $text );
[288] Fix | Delete
}
[289] Fix | Delete
}
[290] Fix | Delete
[291] Fix | Delete
// smart append - field and namespace aware
[292] Fix | Delete
function append($el, $text) {
[293] Fix | Delete
if (!$el) {
[294] Fix | Delete
return;
[295] Fix | Delete
}
[296] Fix | Delete
if ( $this->current_namespace )
[297] Fix | Delete
{
[298] Fix | Delete
if ( $this->initem ) {
[299] Fix | Delete
$this->concat(
[300] Fix | Delete
$this->current_item[ $this->current_namespace ][ $el ], $text);
[301] Fix | Delete
}
[302] Fix | Delete
elseif ($this->inchannel) {
[303] Fix | Delete
$this->concat(
[304] Fix | Delete
$this->channel[ $this->current_namespace][ $el ], $text );
[305] Fix | Delete
}
[306] Fix | Delete
elseif ($this->intextinput) {
[307] Fix | Delete
$this->concat(
[308] Fix | Delete
$this->textinput[ $this->current_namespace][ $el ], $text );
[309] Fix | Delete
}
[310] Fix | Delete
elseif ($this->inimage) {
[311] Fix | Delete
$this->concat(
[312] Fix | Delete
$this->image[ $this->current_namespace ][ $el ], $text );
[313] Fix | Delete
}
[314] Fix | Delete
}
[315] Fix | Delete
else {
[316] Fix | Delete
if ( $this->initem ) {
[317] Fix | Delete
$this->concat(
[318] Fix | Delete
$this->current_item[ $el ], $text);
[319] Fix | Delete
}
[320] Fix | Delete
elseif ($this->intextinput) {
[321] Fix | Delete
$this->concat(
[322] Fix | Delete
$this->textinput[ $el ], $text );
[323] Fix | Delete
}
[324] Fix | Delete
elseif ($this->inimage) {
[325] Fix | Delete
$this->concat(
[326] Fix | Delete
$this->image[ $el ], $text );
[327] Fix | Delete
}
[328] Fix | Delete
elseif ($this->inchannel) {
[329] Fix | Delete
$this->concat(
[330] Fix | Delete
$this->channel[ $el ], $text );
[331] Fix | Delete
}
[332] Fix | Delete
[333] Fix | Delete
}
[334] Fix | Delete
}
[335] Fix | Delete
[336] Fix | Delete
function normalize () {
[337] Fix | Delete
// if atom populate rss fields
[338] Fix | Delete
if ( $this->is_atom() ) {
[339] Fix | Delete
$this->channel['descripton'] = $this->channel['tagline'];
[340] Fix | Delete
for ( $i = 0; $i < count($this->items); $i++) {
[341] Fix | Delete
$item = $this->items[$i];
[342] Fix | Delete
if ( isset($item['summary']) )
[343] Fix | Delete
$item['description'] = $item['summary'];
[344] Fix | Delete
if ( isset($item['atom_content']))
[345] Fix | Delete
$item['content']['encoded'] = $item['atom_content'];
[346] Fix | Delete
[347] Fix | Delete
$this->items[$i] = $item;
[348] Fix | Delete
}
[349] Fix | Delete
}
[350] Fix | Delete
elseif ( $this->is_rss() ) {
[351] Fix | Delete
$this->channel['tagline'] = $this->channel['description'];
[352] Fix | Delete
for ( $i = 0; $i < count($this->items); $i++) {
[353] Fix | Delete
$item = $this->items[$i];
[354] Fix | Delete
if ( isset($item['description']))
[355] Fix | Delete
$item['summary'] = $item['description'];
[356] Fix | Delete
if ( isset($item['content']['encoded'] ) )
[357] Fix | Delete
$item['atom_content'] = $item['content']['encoded'];
[358] Fix | Delete
[359] Fix | Delete
$this->items[$i] = $item;
[360] Fix | Delete
}
[361] Fix | Delete
}
[362] Fix | Delete
}
[363] Fix | Delete
[364] Fix | Delete
function is_rss () {
[365] Fix | Delete
if ( $this->feed_type == RSS ) {
[366] Fix | Delete
return $this->feed_version;
[367] Fix | Delete
}
[368] Fix | Delete
else {
[369] Fix | Delete
return false;
[370] Fix | Delete
}
[371] Fix | Delete
}
[372] Fix | Delete
[373] Fix | Delete
function is_atom() {
[374] Fix | Delete
if ( $this->feed_type == ATOM ) {
[375] Fix | Delete
return $this->feed_version;
[376] Fix | Delete
}
[377] Fix | Delete
else {
[378] Fix | Delete
return false;
[379] Fix | Delete
}
[380] Fix | Delete
}
[381] Fix | Delete
[382] Fix | Delete
function map_attrs($k, $v) {
[383] Fix | Delete
return "$k=\"$v\"";
[384] Fix | Delete
}
[385] Fix | Delete
[386] Fix | Delete
function error( $errormsg, $lvl = E_USER_WARNING ) {
[387] Fix | Delete
if ( MAGPIE_DEBUG ) {
[388] Fix | Delete
trigger_error( $errormsg, $lvl);
[389] Fix | Delete
} else {
[390] Fix | Delete
error_log( $errormsg, 0);
[391] Fix | Delete
}
[392] Fix | Delete
}
[393] Fix | Delete
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
if ( !function_exists('fetch_rss') ) :
[397] Fix | Delete
/**
[398] Fix | Delete
* Build Magpie object based on RSS from URL.
[399] Fix | Delete
*
[400] Fix | Delete
* @since 1.5.0
[401] Fix | Delete
* @package External
[402] Fix | Delete
* @subpackage MagpieRSS
[403] Fix | Delete
*
[404] Fix | Delete
* @param string $url URL to retrieve feed.
[405] Fix | Delete
* @return MagpieRSS|false MagpieRSS object on success, false on failure.
[406] Fix | Delete
*/
[407] Fix | Delete
function fetch_rss ($url) {
[408] Fix | Delete
// initialize constants
[409] Fix | Delete
init();
[410] Fix | Delete
[411] Fix | Delete
if ( !isset($url) ) {
[412] Fix | Delete
// error("fetch_rss called without a url");
[413] Fix | Delete
return false;
[414] Fix | Delete
}
[415] Fix | Delete
[416] Fix | Delete
// if cache is disabled
[417] Fix | Delete
if ( !MAGPIE_CACHE_ON ) {
[418] Fix | Delete
// fetch file, and parse it
[419] Fix | Delete
$resp = _fetch_remote_file( $url );
[420] Fix | Delete
if ( is_success( $resp->status ) ) {
[421] Fix | Delete
return _response_to_rss( $resp );
[422] Fix | Delete
}
[423] Fix | Delete
else {
[424] Fix | Delete
// error("Failed to fetch $url and cache is off");
[425] Fix | Delete
return false;
[426] Fix | Delete
}
[427] Fix | Delete
}
[428] Fix | Delete
// else cache is ON
[429] Fix | Delete
else {
[430] Fix | Delete
// Flow
[431] Fix | Delete
// 1. check cache
[432] Fix | Delete
// 2. if there is a hit, make sure it's fresh
[433] Fix | Delete
// 3. if cached obj fails freshness check, fetch remote
[434] Fix | Delete
// 4. if remote fails, return stale object, or error
[435] Fix | Delete
[436] Fix | Delete
$cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE );
[437] Fix | Delete
[438] Fix | Delete
if (MAGPIE_DEBUG and $cache->ERROR) {
[439] Fix | Delete
debug($cache->ERROR, E_USER_WARNING);
[440] Fix | Delete
}
[441] Fix | Delete
[442] Fix | Delete
$cache_status = 0; // response of check_cache
[443] Fix | Delete
$request_headers = array(); // HTTP headers to send with fetch
[444] Fix | Delete
$rss = 0; // parsed RSS object
[445] Fix | Delete
$errormsg = 0; // errors, if any
[446] Fix | Delete
[447] Fix | Delete
if (!$cache->ERROR) {
[448] Fix | Delete
// return cache HIT, MISS, or STALE
[449] Fix | Delete
$cache_status = $cache->check_cache( $url );
[450] Fix | Delete
}
[451] Fix | Delete
[452] Fix | Delete
// if object cached, and cache is fresh, return cached obj
[453] Fix | Delete
if ( $cache_status == 'HIT' ) {
[454] Fix | Delete
$rss = $cache->get( $url );
[455] Fix | Delete
if ( isset($rss) and $rss ) {
[456] Fix | Delete
$rss->from_cache = 1;
[457] Fix | Delete
if ( MAGPIE_DEBUG > 1) {
[458] Fix | Delete
debug("MagpieRSS: Cache HIT", E_USER_NOTICE);
[459] Fix | Delete
}
[460] Fix | Delete
return $rss;
[461] Fix | Delete
}
[462] Fix | Delete
}
[463] Fix | Delete
[464] Fix | Delete
// else attempt a conditional get
[465] Fix | Delete
[466] Fix | Delete
// set up headers
[467] Fix | Delete
if ( $cache_status == 'STALE' ) {
[468] Fix | Delete
$rss = $cache->get( $url );
[469] Fix | Delete
if ( isset($rss->etag) and $rss->last_modified ) {
[470] Fix | Delete
$request_headers['If-None-Match'] = $rss->etag;
[471] Fix | Delete
$request_headers['If-Last-Modified'] = $rss->last_modified;
[472] Fix | Delete
}
[473] Fix | Delete
}
[474] Fix | Delete
[475] Fix | Delete
$resp = _fetch_remote_file( $url, $request_headers );
[476] Fix | Delete
[477] Fix | Delete
if (isset($resp) and $resp) {
[478] Fix | Delete
if ($resp->status == '304' ) {
[479] Fix | Delete
// we have the most current copy
[480] Fix | Delete
if ( MAGPIE_DEBUG > 1) {
[481] Fix | Delete
debug("Got 304 for $url");
[482] Fix | Delete
}
[483] Fix | Delete
// reset cache on 304 (at minutillo insistent prodding)
[484] Fix | Delete
$cache->set($url, $rss);
[485] Fix | Delete
return $rss;
[486] Fix | Delete
}
[487] Fix | Delete
elseif ( is_success( $resp->status ) ) {
[488] Fix | Delete
$rss = _response_to_rss( $resp );
[489] Fix | Delete
if ( $rss ) {
[490] Fix | Delete
if (MAGPIE_DEBUG > 1) {
[491] Fix | Delete
debug("Fetch successful");
[492] Fix | Delete
}
[493] Fix | Delete
// add object to cache
[494] Fix | Delete
$cache->set( $url, $rss );
[495] Fix | Delete
return $rss;
[496] Fix | Delete
}
[497] Fix | Delete
}
[498] Fix | Delete
else {
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function