diff options
author | Alexandre Alapetite <alexandre@alapetite.fr> | 2025-01-25 09:14:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-25 09:14:08 +0100 |
commit | 22b74b0a5790360d81088a83addab1f98b7f7947 (patch) | |
tree | 2b08182a24cef248ac7ec9bb45c375cb33eb2f55 /app/Controllers | |
parent | 68497030f988cac483a67b27b96d2ac90a54856e (diff) | |
download | freshrss-22b74b0a5790360d81088a83addab1f98b7f7947.tar.gz freshrss-22b74b0a5790360d81088a83addab1f98b7f7947.zip |
Improve cURL proxy options (#7231)
3 is now used for CURLPROXY_HTTPS2
https://github.com/curl/curl/blob/f07612cd9ae1ec50b9bedd749171ad75203c9e7e/include/curl/curl.h#L789
Related to https://github.com/FreshRSS/FreshRSS/issues/7209
Diffstat (limited to 'app/Controllers')
-rwxr-xr-x | app/Controllers/feedController.php | 8 | ||||
-rw-r--r-- | app/Controllers/subscriptionController.php | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 4d64b40b5..00f321ddf 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -175,15 +175,17 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { $max_redirs = Minz_Request::paramInt('curl_params_redirects'); $useragent = Minz_Request::paramString('curl_params_useragent', plaintext: true); $proxy_address = Minz_Request::paramString('curl_params', plaintext: true); - $proxy_type = Minz_Request::paramString('proxy_type', plaintext: true); + $proxy_type = Minz_Request::paramIntNull('proxy_type'); $request_method = Minz_Request::paramString('curl_method', plaintext: true); $request_fields = Minz_Request::paramString('curl_fields', plaintext: true); $headers = Minz_Request::paramTextToArray('http_headers', plaintext: true); $opts = []; - if ($proxy_type !== '') { + if ($proxy_type !== null) { + $opts[CURLOPT_PROXYTYPE] = $proxy_type; + } + if ($proxy_address !== '') { $opts[CURLOPT_PROXY] = $proxy_address; - $opts[CURLOPT_PROXYTYPE] = (int)$proxy_type; } if ($cookie !== '') { $opts[CURLOPT_COOKIE] = $cookie; diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 33e4af340..800f6b7c9 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -157,14 +157,16 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { $max_redirs = Minz_Request::paramInt('curl_params_redirects'); $useragent = Minz_Request::paramString('curl_params_useragent', plaintext: true); $proxy_address = Minz_Request::paramString('curl_params', plaintext: true); - $proxy_type = Minz_Request::paramString('proxy_type', plaintext: true); + $proxy_type = Minz_Request::paramIntNull('proxy_type'); $request_method = Minz_Request::paramString('curl_method', plaintext: true); $request_fields = Minz_Request::paramString('curl_fields', plaintext: true); $headers = Minz_Request::paramTextToArray('http_headers', plaintext: true); $opts = []; - if ($proxy_type !== '') { + if ($proxy_type !== null) { + $opts[CURLOPT_PROXYTYPE] = $proxy_type; + } + if ($proxy_address !== '') { $opts[CURLOPT_PROXY] = $proxy_address; - $opts[CURLOPT_PROXYTYPE] = (int)$proxy_type; } if ($cookie !== '') { $opts[CURLOPT_COOKIE] = $cookie; |