From 655607d7396c3036d7b489ec4c6cb2c3fe63f219 Mon Sep 17 00:00:00 2001 From: Grischa Brockhaus Date: Wed, 2 Jun 2021 13:41:15 +0200 Subject: [PATCH] parse_url does not return port as array, but it is used as array in Request.php So I added a check, wether this is an array actually, else I use the port as intended as int. I would assume, that that array check is needless altogether but maybe old PHP versions needed that? --- src/Unirest/Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Unirest/Request.php b/src/Unirest/Request.php index b49780d..f667cf5 100755 --- a/src/Unirest/Request.php +++ b/src/Unirest/Request.php @@ -555,7 +555,7 @@ class Request $query = '?' . http_build_query(self::getArrayFromQuerystring($query)); } - if ($port && $port[0] !== ':') { + if ($port && (!is_array($port) || $port[0] !== ':')) { $port = ':' . $port; }