From: Alan Knowles Date: Tue, 6 Sep 2011 09:52:15 +0000 (+0800) Subject: MTrack/SCM.php X-Git-Url: http://git.roojs.org/?p=web.mtrack;a=commitdiff_plain;h=e4fd237ff10eaf0c3eddb46ab5783d3a8d7f05cf MTrack/SCM.php --- 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 = ''; /*