mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 10:25:56 +00:00
resolve_redirects: only use three argument version of get_headers() on php 7.1+
This commit is contained in:
@@ -2008,6 +2008,9 @@
|
||||
if ($nest > 10)
|
||||
return false;
|
||||
|
||||
if (version_compare(PHP_VERSION, '7.1.0', '>=')) {
|
||||
$context = stream_context_create($context_options);
|
||||
|
||||
$context_options = array(
|
||||
'http' => array(
|
||||
'header' => array(
|
||||
@@ -2023,8 +2026,10 @@
|
||||
$context_options['http']['proxy'] = _HTTP_PROXY;
|
||||
}
|
||||
|
||||
$context = stream_context_create($context_options);
|
||||
$headers = get_headers($url, 0, $context);
|
||||
} else {
|
||||
$headers = get_headers($url, 0);
|
||||
}
|
||||
|
||||
if (is_array($headers)) {
|
||||
$headers = array_reverse($headers); // last one is the correct one
|
||||
|
||||
Reference in New Issue
Block a user