X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f9001779751f83dc8a10e478bfecb4d8dd5f964c..refs/tags/wordpress-3.5.2:/wp-includes/rss.php diff --git a/wp-includes/rss.php b/wp-includes/rss.php index f23730d0..3b8e4de9 100644 --- a/wp-includes/rss.php +++ b/wp-includes/rss.php @@ -63,7 +63,6 @@ class MagpieRSS { if ( !is_resource($parser) ) trigger_error( "Failed to create an instance of PHP's XML parser. http://www.php.net/manual/en/ref.xml.php"); - $this->parser = $parser; # pass in parser, and a reference to this object @@ -167,7 +166,6 @@ class MagpieRSS { $this->incontent = $el; - } // if inside an Atom content construct (e.g. content or summary) field treat tags as text @@ -206,8 +204,6 @@ class MagpieRSS { } } - - function feed_cdata ($p, $text) { if ($this->feed_type == ATOM and $this->incontent) @@ -436,7 +432,6 @@ function fetch_rss ($url) { debug($cache->ERROR, E_USER_WARNING); } - $cache_status = 0; // response of check_cache $request_headers = array(); // HTTP headers to send with fetch $rss = 0; // parsed RSS object @@ -541,7 +536,7 @@ endif; * @return Snoopy style response */ function _fetch_remote_file($url, $headers = "" ) { - $resp = wp_remote_request($url, array('headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT)); + $resp = wp_remote_request($url, array('headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT, 'reject_unsafe_urls' => true )); if ( is_wp_error($resp) ) { $error = array_shift($resp->errors); @@ -555,7 +550,7 @@ function _fetch_remote_file($url, $headers = "" ) { // Snoopy returns headers unprocessed. // Also note, WP_HTTP lowercases all keys, Snoopy did not. $return_headers = array(); - foreach ( $resp['headers'] as $key => $value ) { + foreach ( wp_remote_retrieve_headers( $resp ) as $key => $value ) { if ( !is_array($value) ) { $return_headers[] = "$key: $value"; } else { @@ -565,10 +560,10 @@ function _fetch_remote_file($url, $headers = "" ) { } $response = new stdClass; - $response->status = $resp['response']['code']; - $response->response_code = $resp['response']['code']; + $response->status = wp_remote_retrieve_response_code( $resp ); + $response->response_code = wp_remote_retrieve_response_code( $resp ); $response->headers = $return_headers; - $response->results = $resp['body']; + $response->results = wp_remote_retrieve_body( $resp ); return $response; } @@ -935,5 +930,3 @@ function get_rss ($url, $num_items = 5) { // Like get posts, but for RSS } } endif; - -?>