src: fix a couple of stray whitespace issues

This commit is contained in:
Franco Fichtner 2021-11-09 13:33:11 +01:00
parent 9b7c35a630
commit f68816a8c2
23 changed files with 96 additions and 102 deletions

View File

@ -71,8 +71,8 @@ CORE_PYTHON?= ${_CORE_PYTHON:[2]:S/./ /g:[1..2]:tW:S/ //}
.endif
.if exists(${PKG})
_CORE_SYSLOGNG!= ${PKG} query %v syslog-ng
CORE_SYSLOGNG?= ${_CORE_SYSLOGNG:S/./ /g:[1..2]:tW:S/ /./g}
_CORE_SYSLOGNG!=${PKG} query %v syslog-ng
CORE_SYSLOGNG?= ${_CORE_SYSLOGNG:S/./ /g:[1..2]:tW:S/ /./g}
.endif
REPLACEMENTS= CORE_ABI \

View File

@ -254,7 +254,7 @@ function filter_configure_sync($verbose = false, $load_aliases = true)
$intfv4 = array();
foreach ($fw->getInterfaceMapping() as $intf => $intfcf) {
if (!empty($intfcf['ifconfig']['ipv4']) && empty($intfcf['gateway'])) {
$intfv4[] = $intf;
$intfv4[] = $intf;
}
}
// add VPN and local networks
@ -585,7 +585,7 @@ function filter_generate_scrubing(&$FilterIflist)
$scrub_rule_out .= "any";
}
if (!empty($scrub_rule['srcport']) && is_alias($scrub_rule['srcport'])) {
$scrub_rule_out .= " port $" . $scrub_rule['srcport'];
$scrub_rule_out .= " port $" . $scrub_rule['srcport'];
} else {
$scrub_rule_out .= !empty($scrub_rule['srcport']) ? " port " . $scrub_rule['srcport'] : "";
}

View File

@ -354,7 +354,7 @@ function legacy_interfaces_details($intf = null)
$next_line = $ifconfig_data[$lineid + 1];
$result[$current_interface]['laggstatistics']['active ports'] = trim(explode(":", $next_line)[1]);
$next_line = $ifconfig_data[$lineid + 1];
$result[$current_interface]['laggstatistics']['flapping'] = trim(explode(":", $next_line)[1]);
$result[$current_interface]['laggstatistics']['flapping'] = trim(explode(":", $next_line)[1]);
} elseif (preg_match("/laggport: (.*)\Wflags=\d+<(.*)> state=\d+<(.*)>$/", $line, $matches)) {
if (empty($result[$current_interface]['laggport'])) {
$result[$current_interface]['laggport'] = [];

View File

@ -397,7 +397,7 @@ function core_user_changed_groups($verbose = false, $username)
foreach ($config['system']['group'] as $group) {
$in_group = !empty($group['member']) && in_array($user['uid'], $group['member']);
$to_remove = in_array($group['name'], $current_groups) && !$in_group;
$to_add = !in_array($group['name'], $current_groups) && $in_group;
$to_add = !in_array($group['name'], $current_groups) && $in_group;
if ($to_remove || $to_add) {
local_group_set($group);
}

View File

@ -667,7 +667,7 @@ function ipsec_dump_spd()
$upperspec = explode("/", $linea[0]);
$cursp['proto'] = $upperspec[0];
list($cursp['src'], $cursp['dst']) = explode("-", $upperspec[2]);
$cursp['reqid'] = substr($upperspec[3], strpos($upperspec[3], "#") + 1);
$cursp['reqid'] = substr($upperspec[3], strpos($upperspec[3], "#") + 1);
break;
}
}
@ -1161,7 +1161,7 @@ function ipsec_configure_do($verbose = false, $interface = '')
if (isset($a_client['net_list'])) {
foreach ($a_phase2 as $ph2ent) {
if (!isset($ph2ent['disabled']) && isset($ph2ent['mobile'])) {
$net_list[] = ipsec_idinfo_to_cidr($ph2ent['localid'], true, $ph2ent['mode']);
$net_list[] = ipsec_idinfo_to_cidr($ph2ent['localid'], true, $ph2ent['mode']);
}
}
}

View File

@ -268,7 +268,7 @@ EOD;
############ Options you really have to take care of ####################
## modules to load
server.modules = (
server.modules = (
"mod_access", "mod_expire", "mod_deflate", "mod_redirect", "mod_setenv",
"mod_cgi", "mod_fastcgi", "mod_alias", "mod_rewrite", "mod_openssl" {$lighty_modules}
)

View File

@ -277,9 +277,9 @@ if (!empty($config['hasync'])) {
// no url provided, assume the backup is using the same settings as our box.
$port = $config['system']['webgui']['port'];
if (!empty($port)) {
$synchronizeto = $config['system']['webgui']['protocol'] . '://'.$hasync['synchronizetoip'].':'.$port."/xmlrpc.php";
$synchronizeto = $config['system']['webgui']['protocol'] . '://'.$hasync['synchronizetoip'].':'.$port."/xmlrpc.php";
} else {
$synchronizeto = $config['system']['webgui']['protocol'] . '://'.$hasync['synchronizetoip']."/xmlrpc.php" ;
$synchronizeto = $config['system']['webgui']['protocol'] . '://'.$hasync['synchronizetoip']."/xmlrpc.php" ;
}
}

View File

@ -196,7 +196,7 @@ class ControllerBase extends ControllerRoot
}
// parse product properties, use template (.in) when not found
$firmware_product_fn = __DIR__ . '/../../../../../version/core';
$firmware_product_fn = __DIR__ . '/../../../../../version/core';
$firmware_product_fn = !is_file($firmware_product_fn) ? $firmware_product_fn . ".in" : $firmware_product_fn;
$product_vars = json_decode(file_get_contents($firmware_product_fn), true);
foreach ($product_vars as $product_key => $product_var) {
@ -234,7 +234,7 @@ class ControllerBase extends ControllerRoot
if (empty($policies[$policy_name])) {
$policies[$policy_name] = "";
}
$policies[$policy_name] .= " {$policy_content}";
$policies[$policy_name] .= " {$policy_content}";
}
$csp = "";
foreach ($policies as $policy_name => $policy) {

View File

@ -1,31 +1,29 @@
<?php
/**
* Copyright (C) 2015 Deciso B.V.
/*
* Copyright (C) 2015 Deciso B.V.
* All rights reserved.
*
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace OPNsense\Auth;
@ -421,19 +419,19 @@ class Radius extends Base implements IAuthConnector
$this->lastAuthProperties['session_timeout'] = radius_cvt_int($resa['data']);
break;
case 85: // Acct-Interim-Interval
$this->lastAuthProperties['Acct-Interim-Interval'] = radius_cvt_int($resa['data']);
$this->lastAuthProperties['Acct-Interim-Interval'] = radius_cvt_int($resa['data']);
break;
case RADIUS_FRAMED_IP_ADDRESS:
$this->lastAuthProperties['Framed-IP-Address'] = radius_cvt_addr($resa['data']);
$this->lastAuthProperties['Framed-IP-Address'] = radius_cvt_addr($resa['data']);
break;
case RADIUS_FRAMED_IP_NETMASK:
$this->lastAuthProperties['Framed-IP-Netmask'] = radius_cvt_addr($resa['data']);
$this->lastAuthProperties['Framed-IP-Netmask'] = radius_cvt_addr($resa['data']);
break;
case RADIUS_FRAMED_ROUTE:
if (empty($this->lastAuthProperties['Framed-Route'])) {
$this->lastAuthProperties['Framed-Route'] = array();
}
$this->lastAuthProperties['Framed-Route'][] = $resa['data'];
$this->lastAuthProperties['Framed-Route'][] = $resa['data'];
break;
default:
break;

View File

@ -123,7 +123,7 @@ class UIModelGrid
// parse rows, because we may need to convert some (list) items we need to know the actual content
// before searching.
$row = array();
$row = [];
$row['uuid'] = $record->getAttributes()['uuid'];
foreach ($fields as $fieldname) {
if ($record->$fieldname != null) {

View File

@ -185,7 +185,7 @@ class Gateways
if (empty($dynamic_gw[(string)$gateway->interface])) {
$dynamic_gw[(string)$gateway->interface] = array();
}
$gw_arr['dynamic'] = true;
$gw_arr['dynamic'] = true;
$dynamic_gw[(string)$gateway->interface][] = $gw_arr;
}
}
@ -448,13 +448,13 @@ class Gateways
foreach ($gw_group->item as $item) {
list($gw, $tier) = explode("|", $item);
if (!isset($tiers[$tier])) {
$tiers[$tier] = array();
$tiers[$tier] = [];
}
$tiers[$tier][] = $gw;
}
}
ksort($tiers);
$all_tiers = array();
$all_tiers = [];
foreach ($tiers as $tieridx => $tier) {
$all_tiers[$tieridx] = array();
if (!isset($result[(string)$gw_group->name])) {

View File

@ -1,31 +1,29 @@
<?php
/**
* Copyright (C) 2016 Deciso B.V.
/*
* Copyright (C) 2016 Deciso B.V.
* All rights reserved.
*
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace OPNsense\Base\Constraints;
@ -64,7 +62,7 @@ abstract class BaseConstraint extends AbstractValidator implements ValidatorInte
$message = 'validation failure ' . get_class($this);
}
if (empty($name)) {
$name = get_class($this);
$name = get_class($this);
}
$validator->appendMessage(new Message($message, $attribute, $name));
}

View File

@ -161,10 +161,10 @@ class ArrayField extends BaseField
if (isset($node->internalChildnodes[$fieldName])) {
if (is_numeric((string)$node->$fieldName)) {
// align numeric values right for sorting, not perfect but works for integer type values
$sortKey .= sprintf("%" . $MAX_KEY_LENGTH . "s,", $node->$fieldName);
$sortKey .= sprintf("%" . $MAX_KEY_LENGTH . "s,", $node->$fieldName);
} else {
// normal text sorting, align left
$sortKey .= sprintf("%-" . $MAX_KEY_LENGTH . "s,", $node->$fieldName);
$sortKey .= sprintf("%-" . $MAX_KEY_LENGTH . "s,", $node->$fieldName);
}
}
}

View File

@ -366,7 +366,7 @@ abstract class BaseField
*/
public function isFieldChanged()
{
return $this->internalInitialValue !== $this->internalValue;
return $this->internalInitialValue !== $this->internalValue;
}
/**

View File

@ -62,7 +62,7 @@ class CountryField extends BaseListField
{
$setid = $this->optionSetId();
if (!isset(self::$internalCacheOptionList[$setid])) {
self::$internalCacheOptionList[$setid] = array();
self::$internalCacheOptionList[$setid] = [];
}
if (empty(self::$internalCacheOptionList[$setid])) {
$filename = '/usr/local/opnsense/contrib/tzdata/iso3166.tab';

View File

@ -1,31 +1,29 @@
<?php
/**
* Copyright (C) 2015 Deciso B.V.
/*
* Copyright (C) 2015 Deciso B.V.
* All rights reserved.
*
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace OPNsense\Base\Menu;
@ -394,7 +392,7 @@ class MenuItem
if ($node->getUrl() != "") {
// hash part isn't available on server end
$menuItemUrl = explode("#", $node->getUrl())[0];
$match = str_replace(array(".", "*","?", "@"), array("\.", ".*","\?", "\@"), $menuItemUrl);
$match = str_replace(array(".", "*","?", "@"), array("\.", ".*","\?", "\@"), $menuItemUrl);
if (preg_match("@^{$match}$@", "{$url}")) {
$node->select();
}

View File

@ -180,7 +180,7 @@ class IDS extends BaseModel
$default_types = $this->action_list;
if (array_key_exists($default, $default_types)) {
foreach ($default_types as $key => $value) {
if ($key == $default) {
if ($key == $default) {
$default_types[$key]['selected'] = 1;
} else {
$default_types[$key]['selected'] = 0;

View File

@ -47,7 +47,7 @@ for param in sys.argv[1:]:
response = {'terminateCause': 'UNKNOWN'}
if parameters['sessionid'] is not None and parameters['zoneid'] is not None:
# remove client
client_session_info = DB().del_client(parameters['zoneid'], parameters['sessionid'])
client_session_info = DB().del_client(parameters['zoneid'], parameters['sessionid'])
if client_session_info is not None:
IPFW().delete(parameters['zoneid'], client_session_info['ip_address'])
client_session_info['terminateCause'] = 'User-Request'

View File

@ -49,7 +49,7 @@ def parse_sa(in_conn):
elif 'local-host' in in_conn:
result['local-addrs'] = in_conn['local-host']
if 'remote_addrs' in in_conn:
result['remote-addrs'] = b','.join(in_conn['remote_addrs'])
result['remote-addrs'] = b','.join(in_conn['remote_addrs'])
elif 'remote-host' in in_conn:
result['remote-addrs'] = in_conn['remote-host']
if 'children' in in_conn:

View File

@ -64,7 +64,7 @@ foreach ((new \OPNsense\Routing\Gateways(legacy_interfaces_details()))->gateways
}
} else {
$gatewayItem['status'] = 'none';
$gatewayItem['status_translated'] = gettext('Online');
$gatewayItem['status_translated'] = gettext('Online');
$gatewayItem['loss'] = '~';
$gatewayItem['stddev'] = '~';
$gatewayItem['delay'] = '~';

View File

@ -80,7 +80,7 @@ if __name__ == '__main__':
filter = inputargs.filter.replace('*', '.*').lower()
if filter.find('*') == -1:
# no wildcard operator, assume partial match
filter = ".*%s.*" % filter
filter = ".*%s.*" % filter
filter_regexp = re.compile(filter)
except sre_constants.error:
# remove illegal expression

View File

@ -4,8 +4,8 @@
############ Options you really have to take care of ####################
## modules to load
server.modules = ( "mod_access", "mod_expire", "mod_deflate", "mod_redirect",
,"mod_cgi", "mod_fastcgi","mod_alias", "mod_rewrite"
server.modules = ( "mod_access", "mod_expire", "mod_deflate", "mod_redirect",
"mod_cgi", "mod_fastcgi","mod_alias", "mod_rewrite"
)
server.max-keep-alive-requests = 15

View File

@ -400,8 +400,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['lock'] = isset($a_interfaces[$if]['lock']);
$pconfig['blockpriv'] = isset($a_interfaces[$if]['blockpriv']);
$pconfig['blockbogons'] = isset($a_interfaces[$if]['blockbogons']);
$pconfig['gateway_interface'] = isset($a_interfaces[$if]['gateway_interface']);
$pconfig['promisc'] = isset($a_interfaces[$if]['promisc']);
$pconfig['gateway_interface'] = isset($a_interfaces[$if]['gateway_interface']);
$pconfig['promisc'] = isset($a_interfaces[$if]['promisc']);
$pconfig['dhcpoverridemtu'] = empty($a_interfaces[$if]['dhcphonourmtu']) ? true : null;
$pconfig['dhcp6-ia-pd-send-hint'] = isset($a_interfaces[$if]['dhcp6-ia-pd-send-hint']);
$pconfig['dhcp6prefixonly'] = isset($a_interfaces[$if]['dhcp6prefixonly']);