104 curl_setopt($fp, CURLOPT_HEADER, 1); |
104 curl_setopt($fp, CURLOPT_HEADER, 1); |
105 curl_setopt($fp, CURLOPT_RETURNTRANSFER, 1); |
105 curl_setopt($fp, CURLOPT_RETURNTRANSFER, 1); |
106 curl_setopt($fp, CURLOPT_FAILONERROR, 1); |
106 curl_setopt($fp, CURLOPT_FAILONERROR, 1); |
107 curl_setopt($fp, CURLOPT_TIMEOUT, $timeout); |
107 curl_setopt($fp, CURLOPT_TIMEOUT, $timeout); |
108 curl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout); |
108 curl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout); |
109 curl_setopt($fp, CURLOPT_REFERER, $url); |
109 curl_setopt($fp, CURLOPT_REFERER, SimplePie_Misc::url_remove_credentials($url)); |
110 curl_setopt($fp, CURLOPT_USERAGENT, $useragent); |
110 curl_setopt($fp, CURLOPT_USERAGENT, $useragent); |
111 curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2); |
111 curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2); |
112 foreach ($curl_options as $curl_param => $curl_value) { |
112 foreach ($curl_options as $curl_param => $curl_value) { |
113 curl_setopt($fp, $curl_param, $curl_value); |
113 curl_setopt($fp, $curl_param, $curl_value); |
114 } |
114 } |
117 if (curl_errno($fp) === 23 || curl_errno($fp) === 61) |
117 if (curl_errno($fp) === 23 || curl_errno($fp) === 61) |
118 { |
118 { |
119 curl_setopt($fp, CURLOPT_ENCODING, 'none'); |
119 curl_setopt($fp, CURLOPT_ENCODING, 'none'); |
120 $this->headers = curl_exec($fp); |
120 $this->headers = curl_exec($fp); |
121 } |
121 } |
|
122 $this->status_code = curl_getinfo($fp, CURLINFO_HTTP_CODE); |
122 if (curl_errno($fp)) |
123 if (curl_errno($fp)) |
123 { |
124 { |
124 $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp); |
125 $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp); |
125 $this->success = false; |
126 $this->success = false; |
126 } |
127 } |