]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-php/Shell.php
Merge pull request #2391 from lonvia/fix-sonar-issues
[nominatim.git] / lib-php / Shell.php
index b43db135c95ada03aa61b4a677cc0d560fb080e1..4bec20e9c35af04d6e6bfe17615e4eaf2a786cea 100644 (file)
@@ -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);
     }
 }