Explorar o código

Define default content type

Cerothen %!s(int64=9) %!d(string=hai) anos
pai
achega
ca3fcff88f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      functions.php

+ 1 - 1
functions.php

@@ -239,7 +239,7 @@ function curl_post($url, $data, $headers = array(), $referer='') {
 	curl_setopt($curlReq, CURLOPT_CUSTOMREQUEST, "POST"); 
 	curl_setopt($curlReq, CURLOPT_RETURNTRANSFER, true);
 	// Format Data
-	switch ($headers['Content-Type']) {
+	switch (isset($headers['Content-Type'])?$headers['Content-Type']:'') {
 		case 'application/json': 
 			curl_setopt($curlReq, CURLOPT_POSTFIELDS, json_encode($data));
 			break;