Skip to content
Merged
7 changes: 6 additions & 1 deletion src/Formatter/CurlCommandFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ public function formatRequest(RequestInterface $request)
} else {
$data = '[non-seekable stream omitted]';
}
$command .= sprintf(' --data %s', escapeshellarg($data));
$escapedData = @escapeshellarg($data);
if (empty($escapedData)) {
$escapedData = 'We couldn\'t not escape the data properly';
}

$command .= sprintf(' --data %s', $escapedData);
}

return $command;
Expand Down