aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Roman D <me@iamroman.org> 2022-08-20 13:06:24 +0300
committerGravatar GitHub <noreply@github.com> 2022-08-20 12:06:24 +0200
commit0ec65788f9a2fb3ab389d22c723e6b36d798a806 (patch)
treed3832b2c07ff74d9c709cbab34feebce3ad66298 /app/Controllers/feedController.php
parent8f475523f52101f818dd4cb9ab22b5429ab39287 (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/feedController.php')
-rwxr-xr-xapp/Controllers/feedController.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 95bca33eb..00759bd18 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -165,6 +165,9 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
$http_auth = $user . ':' . $pass;
}
+ $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', '');
@@ -173,6 +176,18 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
$opts[CURLOPT_PROXY] = $proxy_address;
$opts[CURLOPT_PROXYTYPE] = intval($proxy_type);
}
+ 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;
}