diff --git a/web/inc/helpers.php b/web/inc/helpers.php index 289cee6..e3b0fab 100644 --- a/web/inc/helpers.php +++ b/web/inc/helpers.php @@ -231,7 +231,10 @@ function pictshareUploadImage($path,$hash=false) // output the response curl_setopt($request, CURLOPT_RETURNTRANSFER, true); - $json = json_decode(curl_exec($request).PHP_EOL,true); + $answer = curl_exec($request); + if($answer === false) return ['status'=>'error','error'=>curl_error($request)]; + else + $json = json_decode($answer.PHP_EOL,true); // close the session curl_close($request);