From 9402277b3cd6950219b6a1da436c72c157301295 Mon Sep 17 00:00:00 2001 From: Philip Norton Date: Sun, 1 Feb 2026 23:12:23 +0000 Subject: [PATCH] 19: Made sure that the json strings, when decoded, were properly escaped. --- src/Output/PhpOutput.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Output/PhpOutput.php b/src/Output/PhpOutput.php index f8c26fe..1a46406 100644 --- a/src/Output/PhpOutput.php +++ b/src/Output/PhpOutput.php @@ -42,7 +42,7 @@ public function render(CurlParametersInterface $curlParameters): string if ($curlParameters->hasData()) { switch ($curlParameters->getDataDataType()) { case CurlParameters::DATA_JSON: - $output .= 'curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "' . json_encode($curlParameters->getData()) . '");' . PHP_EOL; + $output .= 'curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "' . str_replace('"', '\"', json_encode($curlParameters->getData())) . '");' . PHP_EOL; break; case CurlParameters::DATA_STRING: $output .= 'curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "' . $curlParameters->getData() . '");' . PHP_EOL;