Closed PJanisio closed 4 months ago
This chunk of code can be improved:
$data = json_decode($c_answer, TRUE); //204 is a special htttp response f.e for API ping if ($data == NULL or curl_getinfo($c, CURLINFO_HTTP_CODE) != 200) { //we didnt received answer if (curl_error($c) != NULL) { echo $this->msg('Error resolving answer: ' . curl_error($c)); $this->redirectMe($this->config['redirectUri'], 3); } else { echo $this->msg('Error resolving answer: '.curl_getinfo($c, CURLINFO_HTTP_CODE). $c_answer); if (isset($c)) { curl_close($c); } return FALSE; }
Done: https://github.com/PJanisio/myuplinkapi/commit/06b7991dc9a8be639bb8bda67820fe391f5eb59a
This chunk of code can be improved: