1
0
Fork 0

Fix perforce arg not being escaped correctly

2.2
Jordi Boggiano 2024-05-29 15:03:59 +02:00
parent 406e3f9ede
commit 47374343a1
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 2 additions and 2 deletions

View File

@ -428,7 +428,7 @@ class Perforce
public function connectClient()
{
$p4CreateClientCommand = $this->generateP4Command(
'client -i < ' . str_replace(" ", "\\ ", $this->getP4ClientSpec())
'client -i < ' . ProcessExecutor::escape($this->getP4ClientSpec())
);
$this->executeCommand($p4CreateClientCommand);
}

View File

@ -339,7 +339,7 @@ class PerforceTest extends TestCase
public function testConnectClient()
{
$expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot -p port client -i < path/composer_perforce_TEST_depot.p4.spec';
$expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot -p port client -i < '.ProcessExecutor::escape('path/composer_perforce_TEST_depot.p4.spec');
$this->processExecutor->expects($this->at(0))
->method('execute')
->with($this->equalTo($expectedCommand), $this->equalTo(null))