Skip to content

Commit

Permalink
fix path whitespace edge case
Browse files Browse the repository at this point in the history
if the file has a space in the path, the command would not account for that and generate an invalid invocation. for example if the path was
/home/hans henrik/wrench/tests/Test/ServerTestHelper.php
the command would previously fail.
  • Loading branch information
divinity76 authored Mar 17, 2024
1 parent 2cf557f commit 816c332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Test/ServerTestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,6 @@ public static function getNextPort(): int
*/
private function getCommand(): string
{
return \sprintf('/usr/bin/env php %s/server.php %d', __DIR__, $this->port);
return \sprintf('/usr/bin/env php ' . escapeshellarg(__DIR__ . '/server.php') . ' %d', $this->port);
}
}

0 comments on commit 816c332

Please sign in to comment.