<?php
+/**
+ * SPDX-License-Identifier: GPL-2.0-only
+ *
+ * This file is part of Nominatim. (https://nominatim.org)
+ *
+ * Copyright (C) 2022 by the Nominatim developer community.
+ * For a full list of authors see the git log.
+ */
namespace Nominatim;
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;
return $iStat;
}
-
-
private function escapeParam($sParam)
{
- if (preg_match('/^-*\w+$/', $sParam)) return $sParam;
- return escapeshellarg($sParam);
+ return (preg_match('/^-*\w+$/', $sParam)) ? $sParam : escapeshellarg($sParam);
}
}