diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Minz/Request.php | 4 | ||||
| -rw-r--r-- | lib/lib_rss.php | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index 3304ad480..a5d599a45 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -120,6 +120,10 @@ class Minz_Request { return $value; } + public static function paramIntNull(string $key): ?int { + return is_numeric(self::$params[$key] ?? null) ? (int)self::$params[$key] : null; + } + public static function paramInt(string $key): int { if (!empty(self::$params[$key]) && is_numeric(self::$params[$key])) { return (int)self::$params[$key]; diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 2a5bdd02f..f0a070820 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -329,6 +329,13 @@ function customSimplePie(array $attributes = [], array $curl_options = []): \Sim } } } + if (!empty($curl_options[CURLOPT_PROXYTYPE]) && ($curl_options[CURLOPT_PROXYTYPE] < 0 || $curl_options[CURLOPT_PROXYTYPE] === 3)) { + // 3 is legacy for NONE + unset($curl_options[CURLOPT_PROXYTYPE]); + if (isset($curl_options[CURLOPT_PROXY])) { + unset($curl_options[CURLOPT_PROXY]); + } + } $simplePie->set_curl_options($curl_options); $simplePie->strip_comments(true); |
