8000 bug #58704 [HttpClient] fix for HttpClientDataCollector fails if proc… · symfony/symfony@22df28a · GitHub
[go: up one dir, main page]

Skip to content

Commit 22df28a

Browse files
bug #58704 [HttpClient] fix for HttpClientDataCollector fails if proc_open is disabled via php.ini (ZaneCEO)
This PR was merged into the 6.4 branch. Discussion ---------- [HttpClient] fix for HttpClientDataCollector fails if proc_open is disabled via php.ini | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #58700 | License | MIT [HttpClientDataCollector::escapePayload](https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/HttpClient/DataCollector/HttpClientDataCollector.php#L256) creates a `new Process()` -> it fails if `proc_open` is disabled: > The Process class relies on proc_open, which is not available on your PHP installation. #58700 Commits ------- e28af34 [HttpClient] Fix Process-based escaping in HttpClientDataCollector 48980a2 fix for HttpClientDataCollector fails if proc_open is disabled via php.ini . Closes #58700
2 parents b30694f + e28af34 commit 22df28a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpClient/DataCollector/HttpClientDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ private function escapePayload(string $payload): string
252252
{
253253
static $useProcess;
254254

255-
if ($useProcess ??= class_exists(Process::class)) {
256-
return (new Process([$payload]))->getCommandLine();
255+
if ($useProcess ??= function_exists('proc_open') && class_exists(Process::class)) {
256+
return substr((new Process(['', $payload]))->getCommandLine(), 3);
257257
}
258258

259259
if ('\\' === \DIRECTORY_SEPARATOR) {

0 commit comments

Comments
 (0)
0