No Code Attached Yet bug
avatar brbrbr
brbrbr
22 Sep 2022

Steps to reproduce the issue

$http = JHttpFactory::getHttp(new JRegistry,'socket');
$response = $http->get(JURI::root(), [], 1 );
var_dump($response);

//JURI::root() redirects to JURI::root() . '/en/';

Expected result

response of the final destination

Actual result

joomla error
utf8_decode(): Argument ($string) must be of type string, array given (JROOT/libraries/vendor/joomla/uri/src/UriHelper.php:42)

SocketTransport::request class itself with $content->headers['Location'] however $content->headers['Location'] is an array.

the new Uri($content->headers['Location']) then fails, using getHeaderLine solves the issue

// Follow Http redirects
        if ($content->code >= 301 && $content->code < 400 && isset($content->headers['Location'])) {
            return $this->request($method, new Uri($content->getHeaderLine('location')), $data, $headers, $timeout, $userAgent);
        }

avatar brbrbr brbrbr - open - 22 Sep 2022
avatar brbrbr brbrbr - change - 22 Sep 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Sep 2022
avatar brbrbr brbrbr - change - 22 Sep 2022
The description was changed
avatar brbrbr brbrbr - edited - 22 Sep 2022
avatar brbrbr brbrbr - edited - 22 Sep 2022
avatar brbrbr brbrbr - change - 22 Sep 2022
The description was changed
avatar brbrbr brbrbr - edited - 22 Sep 2022
avatar brbrbr brbrbr - change - 22 Sep 2022
The description was changed
avatar brbrbr brbrbr - edited - 22 Sep 2022
avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 17 Feb 2023
avatar Hackwar Hackwar - change - 25 Aug 2023
Labels Added: PBF
avatar Hackwar Hackwar - labeled - 25 Aug 2023
avatar brianteeman brianteeman - change - 1 Sep 2023
Labels Removed: PBF
avatar brianteeman brianteeman - unlabeled - 1 Sep 2023
avatar brbrbr brbrbr - change - 7 Jul 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-07-07 20:27:16
Closed_By brbrbr
avatar brbrbr brbrbr - close - 7 Jul 2024
avatar brbrbr
brbrbr - comment - 7 Jul 2024

Solved in #43734

Add a Comment

Login with GitHub to post a comment