diff --git a/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php b/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php index 4dc7db0e4..2bfbfebab 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php +++ b/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php @@ -314,7 +314,7 @@ class FilterRule // set prio if (isset($tmp['set-prio']) && $tmp['set-prio'] !== "" && isset($tmp['set-prio-low']) && $tmp['set-prio-low'] !== "" ) { - $tmp['set-prio'] = "({$tmp['set-prio']}, {$tmp['set-prio-low']})" ; + $tmp['set-prio'] = "({$tmp['set-prio']}, {$tmp['set-prio-low']})"; } $result[] = $tmp; } diff --git a/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php b/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php index effa5ff5c..fafce1f49 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php +++ b/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php @@ -2,7 +2,6 @@ /** * Copyright (C) 2017 Deciso B.V. - * * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,75 +36,75 @@ use \OPNsense\Core\Config; */ class Util { - /** - * is provided address an ip address. - * @param string $network address - * @return boolean - */ - public static function isIpAddress($address) - { - return !empty(filter_var($address, FILTER_VALIDATE_IP)); - } + /** + * is provided address an ip address. + * @param string $network address + * @return boolean + */ + public static function isIpAddress($address) + { + return !empty(filter_var($address, FILTER_VALIDATE_IP)); + } - /** - * is provided network valid - * @param string $network network - * @return boolean - */ - public static function isSubnet($network) - { - $tmp = explode('/', $network); - if (count($tmp) == 2) { - if (self::isIpAddress($tmp[0]) && abs($tmp[1]) == $tmp[1]) { - if (strpos($tmp[0], ':') !== false && $tmp[1] <= 128) { - // subnet v6 - return true; - } elseif ($tmp[1] <= 32) { - // subnet v4 - return true; - } - } - } - return false; - } + /** + * is provided network valid + * @param string $network network + * @return boolean + */ + public static function isSubnet($network) + { + $tmp = explode('/', $network); + if (count($tmp) == 2) { + if (self::isIpAddress($tmp[0]) && abs($tmp[1]) == $tmp[1]) { + if (strpos($tmp[0], ':') !== false && $tmp[1] <= 128) { + // subnet v6 + return true; + } elseif ($tmp[1] <= 32) { + // subnet v4 + return true; + } + } + } + return false; + } - /** - * check if name exists in alias config section - * @param string $name name - * @return boolean - */ - public static function isAlias($name) - { - if (!empty(Config::getInstance()->object()->aliases)) { - foreach (Config::getInstance()->object()->aliases->children() as $node) { - if ($node->name == $name) { - return true; - } - } - } - return false; - } + /** + * check if name exists in alias config section + * @param string $name name + * @return boolean + */ + public static function isAlias($name) + { + if (!empty(Config::getInstance()->object()->aliases)) { + foreach (Config::getInstance()->object()->aliases->children() as $node) { + if ($node->name == $name) { + return true; + } + } + } + return false; + } - /** - * check if name exists in alias config section - * @param string $number port number or range - * @param boolean $allow_range ranges allowed - * @return boolean - */ - public function isPort($number, $allow_range=true) - { - $tmp = explode(':', $number); - foreach ($tmp as $port) { - if (!getservbyname($port, "tcp") && !getservbyname($port, "udp") - && filter_var($port, FILTER_VALIDATE_INT, array( - "options" => array("min_range"=>1, "max_range"=>65535))) === false - ) { - return false; - } - } - if (($allow_range && count($tmp) <=2) || count($tmp) == 1) { - return true; - } - return false; - } + /** + * check if name exists in alias config section + * @param string $number port number or range + * @param boolean $allow_range ranges allowed + * @return boolean + */ + public function isPort($number, $allow_range = true) + { + $tmp = explode(':', $number); + foreach ($tmp as $port) { + if (!getservbyname($port, "tcp") && !getservbyname($port, "udp") + && filter_var($port, FILTER_VALIDATE_INT, array( + "options" => array("min_range"=>1, "max_range"=>65535))) === false + ) { + return false; + } + } + if (($allow_range && count($tmp) <=2) || count($tmp) == 1) { + return true; + } + return false; + } } diff --git a/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/AuthGroupField.php b/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/AuthGroupField.php index 11c03bd89..174a846b2 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/AuthGroupField.php +++ b/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/AuthGroupField.php @@ -33,7 +33,6 @@ use Phalcon\Validation\Validator\InclusionIn; use OPNsense\Base\Validators\CsvListValidator; use OPNsense\Core\Config; - class AuthGroupField extends BaseField { /**