Ticket #3950: 3950.fetch-rss-timeout-addition.patch
| File 3950.fetch-rss-timeout-addition.patch, 1023 bytes (added by , 19 years ago) |
|---|
-
wp-includes/rss.php
375 375 } 376 376 require_once( dirname(__FILE__) . '/class-snoopy.php'); 377 377 378 function fetch_rss ($url ) {378 function fetch_rss ($url, $timeout = false ) { 379 379 // initialize constants 380 380 init(); 381 381 … … 385 385 } 386 386 387 387 // if cache is disabled 388 if ( !MAGPIE_CACHE_ON ) {388 if ( !MAGPIE_CACHE_ON || $timeout === 0) { 389 389 // fetch file, and parse it 390 390 $resp = _fetch_remote_file( $url ); 391 391 if ( is_success( $resp->status ) ) { … … 404 404 // 3. if cached obj fails freshness check, fetch remote 405 405 // 4. if remote fails, return stale object, or error 406 406 407 $cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE);407 $cache = new RSSCache( MAGPIE_CACHE_DIR, ( $timeout === false ? MAGPIE_CACHE_AGE : $timeout ) ); 408 408 409 409 if (MAGPIE_DEBUG and $cache->ERROR) { 410 410 debug($cache->ERROR, E_USER_WARNING);