Skip to content

Commit ca66c16

Browse files
committed
Merge branch 'release/v1.3.3'
2 parents 6be6a06 + c349c92 commit ca66c16

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

CPanel.php

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -183,35 +183,47 @@ public function call($module, $function, $args = array())
183183

184184
curl_close($curl);
185185

186+
$curl_response_decoded = json_decode($curl_res);
187+
186188
$response['inputs']['url'] = $url;
189+
187190
$response['curl_response'] = [
191+
'curl_response' => $curl_res,
192+
'curl_response_decoded' => $curl_response_decoded,
188193
'header_size' => $header_size,
189194
'header' => $header,
190-
'response' => $curl_res,
191195
'body' => $body,
192196
'error' => $err,
193197
'err_no' => $err_no,
194198
];
195199

200+
201+
196202
if ($err || $err_no) {
197203

198204
$response['status'] = 'failed';
199205
$response['errors'] = $err;
200206

201-
} else {
202-
203-
if(isset($res) && isset($res->status) && $res->status == 0)
204-
{
205-
$response['status'] = 'failed';
206-
$response['errors'][] = $res->errors;
207-
$response['inputs']['url'] = $url;
208-
} else
209-
{
210-
$response['data'] = json_decode($curl_res);
211-
$response['status'] = 'success';
212-
$response['inputs']['url'] = $url;
213-
}
207+
} if(isset($curl_response_decoded->errors) && count($curl_response_decoded->errors) > 0)
208+
{
209+
$response['status'] = 'failed';
210+
$response['errors'] = $curl_response_decoded->errors;
211+
212+
} else {
213+
214+
if(isset($res) && isset($res->status) && $res->status == 0)
215+
{
216+
$response['status'] = 'failed';
217+
$response['errors'][] = $res->errors;
218+
$response['inputs']['url'] = $url;
219+
} else
220+
{
221+
$response['data'] = json_decode($curl_res);
222+
$response['status'] = 'success';
223+
$response['inputs']['url'] = $url;
214224
}
225+
}
226+
215227

216228
return $response;
217229
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"keywords": ["laravel", "cpanel", "cpanel api", "cpanel uapi"],
55
"homepage": "https://www.webreinvent.com",
66
"license": "MIT",
7-
"version": "1.3.2",
7+
"version": "1.3.3",
88
"authors": [
99
{
1010
"name": "WebReinvent",

0 commit comments

Comments
 (0)