Rev 715 | Rev 719 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 715 | Rev 716 | ||
---|---|---|---|
Line 302... | Line 302... | ||
302 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
302 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
303 | curl_setopt($ch, CURLOPT_AUTOREFERER, true); |
303 | curl_setopt($ch, CURLOPT_AUTOREFERER, true); |
304 | if (!($res = @curl_exec($ch))) return false; |
304 | if (!($res = @curl_exec($ch))) return false; |
305 | curl_close($ch); |
305 | curl_close($ch); |
306 | } else { |
306 | } else { |
- | 307 | $opts = [ |
|
- | 308 | "http" => [ |
|
- | 309 | "method" => "GET", |
|
- | 310 | "header" => "User-Agent: ViaThinkSoft-OIDplus/2.0\r\n" |
|
- | 311 | ] |
|
- | 312 | ]; |
|
- | 313 | $context = stream_context_create($opts); |
|
307 | $res = @file_get_contents($url); |
314 | $res = @file_get_contents($url, false, $context); |
308 | if ($res === false) return false; |
315 | if ($res === false) return false; |
309 | } |
316 | } |
310 | return $res; |
317 | return $res; |
311 | } |
318 | } |