fixes #1712 fallback to fetchRemote function, works best

This commit is contained in:
plegall
2022-08-27 17:27:03 +02:00
parent 002abf87df
commit 8d1e97c8b7

View File

@@ -3476,23 +3476,7 @@ function get_piwigo_news($start, $count)
$forum_url = PHPWG_URL.'/forum';
$url = $forum_url.'/news.php?format=json&limit='.$count;
if (conf_get_param('porg_fetch_news_check_ssl', true))
{
$content = file_get_contents($url);
}
else
{
$arrContextOptions = array(
"ssl" => array(
"verify_peer" => false,
"verify_peer_name" => false,
),
);
$content = file_get_contents($url, false, stream_context_create($arrContextOptions));
}
if ($content !== false)
if (fetchRemote($url, $content))
{
$all_news = array();