X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e14e7c6235a40dbec451146bcb3aaec013d659c9..ec474594105d8c60f04a10a48afe8420cd41b299:/lib-php/Shell.php?ds=inline diff --git a/lib-php/Shell.php b/lib-php/Shell.php index b43db135..4be13235 100644 --- a/lib-php/Shell.php +++ b/lib-php/Shell.php @@ -1,4 +1,12 @@ aEnv)) $this->aEnv = $_ENV; + if (!isset($this->aEnv)) { + $this->aEnv = $_ENV; + } $this->aEnv = array_merge($this->aEnv, array($sKey => $sVal), $_ENV); } return $this; @@ -75,11 +85,8 @@ class Shell return $iStat; } - - private function escapeParam($sParam) { - if (preg_match('/^-*\w+$/', $sParam)) return $sParam; - return escapeshellarg($sParam); + return (preg_match('/^-*\w+$/', $sParam)) ? $sParam : escapeshellarg($sParam); } }