X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e14e7c6235a40dbec451146bcb3aaec013d659c9..b593fe9c3e9dd333d870b38e570a898c5f1185f3:/lib-php/Shell.php 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); } }