diff options
author | Guillaume Mazoyer <gmazoyer@gravitons.in> | 2016-07-11 19:14:33 +0200 |
---|---|---|
committer | Guillaume Mazoyer <gmazoyer@gravitons.in> | 2016-07-11 19:14:33 +0200 |
commit | d6c4a03aca0a7b052c3ff5cb48c6455245f61d72 (patch) | |
tree | 06f1cdf03d7b1dfa2a20b9b0786493899719c789 | |
parent | 7cf3a7cb295bd7425bf7590234079ebd203567d4 (diff) |
Use a variable when using array index.
-rw-r--r-- | execute.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/execute.php b/execute.php index 7fd8fc6..ad8831e 100644 --- a/execute.php +++ b/execute.php @@ -52,16 +52,17 @@ if (isset($_POST['query']) && !empty($_POST['query']) && // Do the processing $router = Router::instance($hostname, $requester); + $router_config = $router->get_config(); // Check if parameter is an IPv6 and if IPv6 is disabled - if (match_ipv6($parameter) && $router->get_config()['disable_ipv6']) { + if (match_ipv6($parameter) && $router_config['disable_ipv6']) { $error = 'IPv6 has been disabled for this router, you can only use IPv4.'; print(json_encode(array('error' => $error))); return; } // Check if parameter is an IPv4 and if IPv4 is disabled - if (match_ipv4($parameter) && $router->get_config()['disable_ipv4']) { + if (match_ipv4($parameter) && $router_config['disable_ipv4']) { $error = 'IPv4 has been disabled for this router, you can only use IPv6.'; print(json_encode(array('error' => $error))); return; |