andre 3 лет назад
Родитель
Сommit
8c2811d2e2
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      api/cwp7/Admin.php

+ 2 - 2
api/cwp7/Admin.php

@@ -398,8 +398,6 @@ class cwp7_Admin {
         curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
         curl_setopt($ch, CURLOPT_POST, 1);
         $response = curl_exec($ch);
-        if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) != 200) {
-            curl_close($ch);
 
         logModuleCall(
             'cwp7',
@@ -409,6 +407,8 @@ class cwp7_Admin {
             $response
         );
 
+        if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) != 200) {
+            curl_close($ch);
             return array('status' => 'Error', 'err_msg' => curl_error($ch));
         };
         curl_close($ch);