diff options
| author | 2022-08-20 13:06:24 +0300 | |
|---|---|---|
| committer | 2022-08-20 12:06:24 +0200 | |
| commit | 0ec65788f9a2fb3ab389d22c723e6b36d798a806 (patch) | |
| tree | d3832b2c07ff74d9c709cbab34feebce3ad66298 /app/Controllers/subscriptionController.php | |
| parent | 8f475523f52101f818dd4cb9ab22b5429ab39287 (diff) | |
Implemented advanced feed settings to allow cookies and HTTP redirects. (#4470)
* Implemented advanced feed settings to allow cookies and HTTP redirects.
* i18n fr
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Controllers/subscriptionController.php')
| -rw-r--r-- | app/Controllers/subscriptionController.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index bbefc2d68..cca41b004 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -143,6 +143,8 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { $feed->_attributes('read_when_same_title_in_feed', $read_when_same_title_in_feed); $cookie = Minz_Request::param('curl_params_cookie', ''); + $cookie_file = Minz_Request::paramBoolean('curl_params_cookiefile'); + $max_redirs = intval(Minz_Request::param('curl_params_redirects', 0)); $useragent = Minz_Request::param('curl_params_useragent', ''); $proxy_address = Minz_Request::param('curl_params', ''); $proxy_type = Minz_Request::param('proxy_type', ''); @@ -154,6 +156,15 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { if ($cookie !== '') { $opts[CURLOPT_COOKIE] = $cookie; } + if ($cookie_file) { + // Pass empty cookie file name to enable the libcurl cookie engine + // without reading any existing cookie data. + $opts[CURLOPT_COOKIEFILE] = ''; + } + if ($max_redirs != 0) { + $opts[CURLOPT_MAXREDIRS] = $max_redirs; + $opts[CURLOPT_FOLLOWLOCATION] = 1; + } if ($useragent !== '') { $opts[CURLOPT_USERAGENT] = $useragent; } |
