Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ public function __construct(string $url, int $timeout = 10, int $redirects = 5,
$this->success = false;
return;
}
$proxy = preg_replace('#^.*://#i', '', $proxy); // Strip any scheme already present in CURLOPT_PROXY
$proxy_url = "$proxy_scheme://$proxy"; // CURLOPT_PROXY ($proxy) is formatted as user:pass@hostname:port, with the part before @ being optional
// CURLOPT_PROXY ($proxy) is expected to already be scheme-less: the scheme comes from
// CURLOPT_PROXYTYPE, and the caller (e.g. FreshRSS_http_Util::sanitizeCurlParams()) rejects
// any scheme-containing value before it's ever stored or used.
$proxy_url = "$proxy_scheme://$proxy"; // formatted as user:pass@hostname:port, with the part before @ being optional
$resolve = $this->get_curl_resolve_info($proxy_url);
if ($resolve === null) {
$this->error = 'Failed to fetch this URL, because the proxy’s IP is not in the allowlist [' .
Expand Down
Loading