Remove a PHP < 7.1 branch in UrlHelper.
This commit is contained in:
parent
93fd85df6f
commit
7567676ed8
|
@ -190,7 +190,6 @@ class UrlHelper {
|
||||||
if ($nest > 10)
|
if ($nest > 10)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (version_compare(PHP_VERSION, '7.1.0', '>=')) {
|
|
||||||
$context_options = array(
|
$context_options = array(
|
||||||
'http' => array(
|
'http' => array(
|
||||||
'header' => array(
|
'header' => array(
|
||||||
|
@ -208,14 +207,9 @@ class UrlHelper {
|
||||||
|
|
||||||
$context = stream_context_create($context_options);
|
$context = stream_context_create($context_options);
|
||||||
|
|
||||||
// PHP 8 changed the second param from int to bool, but we still support PHP >= 7.1.0
|
// PHP 8 changed the second param from int to bool, but we still support PHP >= 7.4.0
|
||||||
// @phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
$headers = get_headers($url, 0, $context);
|
$headers = get_headers($url, 0, $context);
|
||||||
} else {
|
|
||||||
// PHP 8 changed the second param from int to bool, but we still support PHP >= 7.1.0
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
$headers = get_headers($url, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_array($headers)) {
|
if (is_array($headers)) {
|
||||||
$headers = array_reverse($headers); // last one is the correct one
|
$headers = array_reverse($headers); // last one is the correct one
|
||||||
|
|
Loading…
Reference in New Issue