mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
Merge pull request #629 from who/develop_2.0
Correct usage of strpos in PHP APIClient mustache template
This commit is contained in:
commit
444666a365
@ -94,7 +94,7 @@ class APIClient {
|
||||
$headers[] = $this->headerName . ": " . $this->headerValue;
|
||||
}
|
||||
|
||||
if ((isset($headers['Content-Type']) and strpos($headers['Content-Type'], "multipart/form-data") < 0) and (is_object($postData) or is_array($postData))) {
|
||||
if ((isset($headers['Content-Type']) and strpos($headers['Content-Type'], "multipart/form-data") === FALSE) and (is_object($postData) or is_array($postData))) {
|
||||
$postData = json_encode($this->sanitizeForSerialization($postData));
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ class {{classname}} {
|
||||
}
|
||||
|
||||
// for HTTP post (form)
|
||||
if (strpos($headerParams['Content-Type'], "application/x-www-form-urlencoded") > -1) {
|
||||
if (strpos($headerParams['Content-Type'], "application/x-www-form-urlencoded") !== FALSE) {
|
||||
$httpBody = http_build_query($formParams);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user