mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
api dns, better to use parameter for address (list) https://github.com/opnsense/core/issues/1788
This commit is contained in:
parent
41755d0e02
commit
3a3bb837c5
@ -41,14 +41,17 @@ class DnsController extends ApiControllerBase
|
||||
|
||||
/**
|
||||
* perform a reverse dns lookup
|
||||
* @param string|array $address ip address or list of addresses
|
||||
* @return array
|
||||
*/
|
||||
public function reverse_lookupAction($address)
|
||||
public function reverse_lookupAction()
|
||||
{
|
||||
if ($this->request->isGet()) {
|
||||
if ($this->request->isGet() && $this->request->has('address')) {
|
||||
$this->sessionClose(); // long running action, close session
|
||||
$address = !is_array($address) ? array($address) : $address;
|
||||
if (is_array($this->request->get('address'))) {
|
||||
$address = $this->request->get('address');
|
||||
} else {
|
||||
$address = array($this->request->get('address'));
|
||||
}
|
||||
$result = array();
|
||||
foreach ($address as $addr) {
|
||||
$result[] = gethostbyaddr($addr);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user