"Network::unparseURL" is replaced with "Uri::fromParts"

This commit is contained in:
Michael 2024-05-14 21:47:57 +00:00
parent a6f3c961dc
commit 1c66d49599
9 changed files with 17 additions and 49 deletions

View file

@ -33,6 +33,7 @@ use GuzzleHttp\Client;
use GuzzleHttp\Cookie\FileCookieJar;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Exception\TransferException;
use GuzzleHttp\Psr7\Uri;
use GuzzleHttp\RequestOptions;
use mattwright\URLResolver;
use Psr\Http\Message\ResponseInterface;
@ -104,7 +105,7 @@ class HttpClient implements ICanSendHttpRequests
}
}
$parts['path'] = implode('/', $parts2);
$url = Network::unparseURL($parts);
$url = (string)Uri::fromParts((array)$parts);
if (Network::isUrlBlocked($url)) {
$this->logger->info('Domain is blocked.', ['url' => $url]);

View file

@ -21,10 +21,9 @@
namespace Friendica\Network\HTTPClient\Response;
use Friendica\Core\Logger;
use Friendica\Network\HTTPClient\Capability\ICanHandleHttpResponses;
use Friendica\Network\HTTPException\UnprocessableEntityException;
use Friendica\Util\Network;
use GuzzleHttp\Psr7\Uri;
use Psr\Log\LoggerInterface;
/**
@ -224,7 +223,7 @@ class CurlResult implements ICanHandleHttpResponses
}
}
$this->redirectUrl = Network::unparseURL($redirect_parts);
$this->redirectUrl = (string)Uri::fromParts((array)$redirect_parts);
$this->isRedirectUrl = true;
} else {