From e4fd237ff10eaf0c3eddb46ab5783d3a8d7f05cf Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 6 Sep 2011 17:52:15 +0800 Subject: [PATCH] MTrack/SCM.php --- MTrack/SCM.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/MTrack/SCM.php b/MTrack/SCM.php index 1cd45510..e25fee19 100644 --- a/MTrack/SCM.php +++ b/MTrack/SCM.php @@ -104,7 +104,18 @@ abstract class MTrackSCM } } - + function escapeArg($a) { + if (preg_match('/\-[a-z0-9]+$/i', $a)) { + return $a; // raw -a + } + if (preg_match('/\-\-[a-z0-9]+=/i', $a)) { + $lr = explode('=', $a,2); + return $lr[0].'=' . escapeshellarg($lr[1]); // raw -a + } + return escapeshellarg($a); + + + } public $repopath = ''; /* -- 2.39.2