diff options
author | Guillaume Mazoyer <gmazoyer@gravitons.in> | 2016-08-25 08:50:26 +0200 |
---|---|---|
committer | Guillaume Mazoyer <gmazoyer@gravitons.in> | 2016-08-25 08:50:26 +0200 |
commit | 73853ac442ecf471d89e3501aa76e45f03beb539 (patch) | |
tree | e2a649e787c9db86ee81d804322b0d1804956a5f | |
parent | b125fa0ca129beaf819f10e7399c9878b47e905e (diff) |
Ensure default values are set.
-rw-r--r-- | routers/router.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/routers/router.php b/routers/router.php index 6e564d6..26a9226 100644 --- a/routers/router.php +++ b/routers/router.php @@ -39,6 +39,17 @@ abstract class Router { $this->config = $config; $this->id = $id; $this->requester = $requester; + + // Set defaults if not present + if (!isset($this->config['timeout'])) { + $this->config['timeout'] = 30; + } + if (!isset($this->config['disable_ipv6'])) { + $this->config['disable_ipv6'] = false; + } + if (!isset($this->config['disable_ipv4'])) { + $this->config['disable_ipv4'] = false; + } } private function sanitize_output($output) { |