diff --git a/src/Formatter/CurlCommandFormatter.php b/src/Formatter/CurlCommandFormatter.php index 5cdd427..8060250 100644 --- a/src/Formatter/CurlCommandFormatter.php +++ b/src/Formatter/CurlCommandFormatter.php @@ -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;