X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/32683f73c787464e16f2a146d4c08c4041087dd5..3905dd68dd5b261449df7df243c594b25995d8bd:/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); } }