X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e14e7c6235a40dbec451146bcb3aaec013d659c9..3905dd68dd5b261449df7df243c594b25995d8bd:/lib-php/Shell.php?ds=sidebyside 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); } }