From ef760f0c8e59bb666be3874fd9fc789e2dbfd210 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 27 Oct 2023 12:13:19 +0200 Subject: [PATCH] added error message --- web/inc/helpers.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);