From c180f65af8c0cd9c93355966b38f9a061ff704ba Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 11 Mar 2021 10:06:59 +0100 Subject: [PATCH] curl avant stream open --- core/class/helper.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 2f505797..a0866708 100755 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -53,18 +53,18 @@ class helper { if(function_exists('file_get_contents') && ini_get('allow_url_fopen') ){ $url_get_contents_data = @file_get_contents($url); // Masque un warning éventuel - }elseif(function_exists('fopen') && - function_exists('stream_get_contents') && - ini_get('allow_url_fopen')){ - $handle = fopen ($url, "r"); - $url_get_contents_data = stream_get_contents($handle); }elseif(function_exists('curl_version')){ $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $url_get_contents_data = curl_exec($ch); - curl_close($ch); + curl_close($ch); + }elseif(function_exists('fopen') && + function_exists('stream_get_contents') && + ini_get('allow_url_fopen')){ + $handle = fopen ($url, "r"); + $url_get_contents_data = stream_get_contents($handle); }else{ $url_get_contents_data = false; }