PluginProbe
Friends / 2.9.0
Friends v2.9.0
4.3.2 4.3.1 4.3.0 4.2.2 4.2.1 4.2.0 4.1.0 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.0 2.9.1 All 88 releases
friends / feed-parsers / SimplePie / class-simplepie-file-accept-only-rss.php

class-simplepie-file-accept-only-rss.php in Friends 2.9.0, at feed-parsers/SimplePie/class-simplepie-file-accept-only-rss.php

42 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Friends: SimplePie_File_Accept_Only_RSS class
4 *
5 * @package Friends
6 * @since 1.0
7 */
8
9 namespace Friends;
10
11 /**
12 * Send an accept header that only allows for Atom or RSS.
13 *
14 * @see \WP_SimplePie_File
15 */
16 class SimplePie_File_Accept_Only_RSS extends \WP_SimplePie_File {
17
18 /**
19 * Constructor.
20 *
21 * @since 2.8.0
22 * @since 3.2.0 Updated to use a PHP5 constructor.
23 *
24 * @param string $url Remote file URL.
25 * @param int $timeout Optional. How long the connection should stay open in seconds.
26 * Default 10.
27 * @param int $redirects Optional. The number of allowed redirects. Default 5.
28 * @param string|array $headers Optional. Array or string of headers to send with the request.
29 * Default null.
30 * @param string $useragent Optional. User-agent value sent. Default null.
31 * @param bool $force_fsockopen Optional. Whether to force opening internet or unix domain socket
32 * connection or not. Default false.
33 */
34 public function __construct( $url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false ) {
35 if ( ! is_array( $headers ) ) {
36 $headers = array();
37 }
38 $headers['Accept'] = 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9';
39 return parent::__construct( $url, $timeout, $redirects, $headers, $useragent, $force_fsockopen );
40 }
41 }
42