mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Escape path
This commit is contained in:
parent
f599693f11
commit
d26e71971f
|
|
@ -49,7 +49,7 @@ class Git
|
|||
public static function test() : bool
|
||||
{
|
||||
$pipes = [];
|
||||
$resource = proc_open(Git::getBin(), [1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
|
||||
$resource = proc_open(escapeshellarg(Git::getBin()), [1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
|
||||
|
||||
$stdout = stream_get_contents($pipes[1]);
|
||||
$stderr = stream_get_contents($pipes[2]);
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ class Repository
|
|||
*/
|
||||
private function run(string $cmd) : array
|
||||
{
|
||||
$cmd = Git::getBin() . ' ' . $cmd;
|
||||
$cmd = escapeshellarg(Git::getBin()) . ' ' . $cmd;
|
||||
$pipes = [];
|
||||
$desc = [
|
||||
1 => ['pipe', 'w'],
|
||||
|
|
@ -203,7 +203,7 @@ class Repository
|
|||
|
||||
$status = trim(proc_close($resource));
|
||||
|
||||
if ($status) {
|
||||
if ($status == -1) {
|
||||
throw new \Exception($stderr);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user