From d7983fd99fd239706aa6f6e09282bf8f2292fe75 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 12 Mar 2020 15:07:53 +0100 Subject: [PATCH] whitespace / consistency for https://github.com/opnsense/core/pull/3976 --- .../OPNsense/Firewall/Api/AliasUtilController.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/AliasUtilController.php b/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/AliasUtilController.php index 8e96fb531..3455aedcd 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/AliasUtilController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/AliasUtilController.php @@ -176,10 +176,8 @@ class AliasUtilController extends ApiControllerBase { $this->sessionClose(); if ($this->request->isPost() && $this->request->hasPost("address")) { - $address = $this->request->getPost("address"); - Config::getInstance()->lock(); - + $address = $this->request->getPost("address"); $cnfAlias = $this->getAlias($alias); if ($cnfAlias !== null && in_array($cnfAlias->type, array('host', 'network'))) { // update local administration, remove address when found for static types @@ -225,13 +223,11 @@ class AliasUtilController extends ApiControllerBase { $this->sessionClose(); if ($this->request->isPost() && $this->request->hasPost("address")) { + Config::getInstance()->lock(); $address = $this->request->getPost("address"); if (preg_match("/[^0-9a-f\:\.\/_]/", $address)) { return array("status" => "not_an_address"); } - - Config::getInstance()->lock(); - $cnfAlias = $this->getAlias($alias); if ($cnfAlias !== null && in_array($cnfAlias->type, array('host', 'network'))) { // update local administration, add address when not found for static types