X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e14e7c6235a40dbec451146bcb3aaec013d659c9..7e7dd769fda191b50df62a24cfcb0832e5b3eeed:/lib-php/Shell.php diff --git a/lib-php/Shell.php b/lib-php/Shell.php index b43db135..4bec20e9 100644 --- a/lib-php/Shell.php +++ b/lib-php/Shell.php @@ -33,7 +33,9 @@ class Shell public function addEnvPair($sKey, $sVal) { if (isset($sKey) && $sKey && isset($sVal)) { - if (!isset($this->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 +77,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); } }