From 7bdc53125c9018cde7788bc396e571d8a89888b2 Mon Sep 17 00:00:00 2001 From: Dag Date: Thu, 24 Mar 2022 00:11:33 +0100 Subject: [PATCH] fix: properly verify the existence of the curl module This fixes a bug where it didnt use curl from cli even though it's installed. I believe this preserves the original intention to not require the curl module to be installed. https://github.com/RSS-Bridge/rss-bridge/pull/979 --- lib/contents.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/contents.php b/lib/contents.php index 38a8a184..99e7d22b 100644 --- a/lib/contents.php +++ b/lib/contents.php @@ -130,8 +130,8 @@ function getContents($url, $header = array(), $opts = array(), $returnHeader = f 'content' => '', ); - // Use file_get_contents if in CLI mode with no root certificates defined - if(php_sapi_name() === 'cli' && empty(ini_get('curl.cainfo'))) { + // Use file_get_contents() if curl module is not installed + if(! function_exists('curl_version')) { $httpHeaders = '';