Skip to content

Commit

Permalink
Raw placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jun 21, 2021
1 parent 3770554 commit aae865c
Showing 1 changed file with 8 additions and 5 deletions.
Expand Up @@ -324,10 +324,6 @@ public static function makeRequest($host, $methodSettings, $paramsCustomer)
$replaceVariablesJSON[$keyDynamic] = json_encode($valueDynamic);
}

foreach ($replaceVariablesJSON as $keyVariable) {
$replaceVariablesJSON['raw_'.$keyVariable] = trim($replaceVariablesJSON[$keyVariable],"\"");
}

if (isset($methodSettings['conditions']) && is_array($methodSettings['conditions']) && !empty($methodSettings['conditions'])) {
foreach ($methodSettings['conditions'] as $condition){

Expand Down Expand Up @@ -485,7 +481,14 @@ public static function makeRequest($host, $methodSettings, $paramsCustomer)
}

} elseif (isset($methodSettings['body_request_type']) && $methodSettings['body_request_type'] == 'raw') {
$bodyPOST = str_replace(array_keys($replaceVariablesJSON), array_values($replaceVariablesJSON), $file_api === true ? $methodSettings['body_raw_file'] : $methodSettings['body_raw']);

$rawReplaceArray = array();
foreach ($replaceVariablesJSON as $keyVariable) {
$rawReplaceArray['raw_'.$keyVariable] = trim($replaceVariablesJSON[$keyVariable],"\"");
}

$bodyPOST = str_replace(array_keys($rawReplaceArray), array_values($rawReplaceArray), $file_api === true ? $methodSettings['body_raw_file'] : $methodSettings['body_raw']);
$bodyPOST = str_replace(array_keys($replaceVariablesJSON), array_values($replaceVariablesJSON), $bodyPOST);
$bodyPOST = preg_replace('/{{lhc\.(var|add)\.(.*?)}}/','""',$bodyPOST);

curl_setopt($ch, CURLOPT_POSTFIELDS, $bodyPOST);
Expand Down

0 comments on commit aae865c

Please sign in to comment.