Skip to content

Commit c9206f0

Browse files
llaakkkkNyholm
authored andcommitted
Bug/curl fromater fails (#94)
* Added check escapeshellarg with data * Added check escapeshellarg with data * Fixed uses * Fixed code format * Fixed code format * Fixed code format * Added die when escapeshallarg failed * Fixed code format * Fixed silently suppress error * Fixed silently suppress error code readable * Fixed formatting * Fixed foramting
1 parent dafefdb commit c9206f0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Formatter/CurlCommandFormatter.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ public function formatRequest(RequestInterface $request)
4545
} else {
4646
$data = '[non-seekable stream omitted]';
4747
}
48-
$command .= sprintf(' --data %s', escapeshellarg($data));
48+
$escapedData = @escapeshellarg($data);
49+
if (empty($escapedData)) {
50+
$escapedData = 'We couldn\'t not escape the data properly';
51+
}
52+
53+
$command .= sprintf(' --data %s', $escapedData);
4954
}
5055

5156
return $command;

0 commit comments

Comments
 (0)