mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-14 18:23:52 -04:00
Limit cURL to protocols HTTP, HTTPS (#8713)
This commit is contained in:
committed by
GitHub
parent
3ec1920cc5
commit
497d6a7afb
@@ -44,6 +44,20 @@ final class FreshRSS_SimplePieCustom extends \SimplePie\SimplePie
|
||||
unset($curl_options[CURLOPT_PROXY]);
|
||||
}
|
||||
}
|
||||
if (defined('CURLOPT_PROTOCOLS_STR')) {
|
||||
$curl_options[CURLOPT_PROTOCOLS_STR] = 'http,https';
|
||||
if (defined('CURLOPT_REDIR_PROTOCOLS_STR')) {
|
||||
$curl_options[CURLOPT_REDIR_PROTOCOLS_STR] = 'http,https';
|
||||
}
|
||||
} elseif (defined('CURLPROTO_HTTP') && defined('CURLPROTO_HTTPS')) {
|
||||
// Legacy PHP 8.2-
|
||||
if (defined('CURLOPT_PROTOCOLS')) {
|
||||
$curl_options[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
|
||||
}
|
||||
if (defined('CURLOPT_REDIR_PROTOCOLS')) {
|
||||
$curl_options[CURLOPT_REDIR_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
|
||||
}
|
||||
}
|
||||
$this->set_curl_options($curl_options);
|
||||
|
||||
$this->strip_comments(true);
|
||||
|
||||
Reference in New Issue
Block a user