Ensure numeric validation for configuration variables and set default for server keypair expiration
This commit is contained in:
parent
00f1db8180
commit
50f998c2ab
2 changed files with 2 additions and 2 deletions
|
@ -348,7 +348,7 @@
|
|||
case 'SB_CRYPTO_KEYPAIR_EXPIRES':
|
||||
case 'SB_CRYPTO_ENCRYPTION_KEYS_COUNT':
|
||||
case 'SB_CACHE_PORT':
|
||||
if($variable !== false)
|
||||
if($variable !== false && is_numeric($variable))
|
||||
{
|
||||
Configuration::getConfigurationLib()->set($config, (int) $variable);
|
||||
Program::getLogger()->info(sprintf('Set %s to %s', $config, $variable));
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
public function __construct(array $data)
|
||||
{
|
||||
$this->serverName = $data['server_name'];
|
||||
$this->serverKeypairExpires = $data['server_keypair_expires'];
|
||||
$this->serverKeypairExpires = (int)$data['server_keypair_expires'] ?? 0;
|
||||
$this->transportEncryptionAlgorithm = $data['transport_encryption_algorithm'];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue