Small fixes (#3096)

This commit is contained in:
Michael Steenbeek 2019-01-04 09:26:16 +01:00 committed by Franco Fichtner
parent 8257d884d5
commit 2c61e068a2
27 changed files with 59 additions and 46 deletions

View File

@ -54,7 +54,7 @@
class idna_convert
{
/**
* Holds all relevant mapping tables, loaded from a seperate file on construct
* Holds all relevant mapping tables, loaded from a separate file on construct
* See RFC3454 for details
*
* @var array

View File

@ -630,7 +630,7 @@ class SimplePie_Parse_Date
/**
* Parse a superset of W3C-DTF (allows hyphens and colons to be omitted, as
* well as allowing any of upper or lower case "T", horizontal tabs, or
* spaces to be used as the time seperator (including more than one))
* spaces to be used as the time separator (including more than one))
*
* @access protected
* @return int Timestamp

View File

@ -127,7 +127,7 @@ class Net_IPv6
*
* @param String $ip the (compressed) IP as Hex representation
*
* @return Array the first element is the IP, the second the prefix length
* @return array the first element is the IP, the second the prefix length
* @since 1.2.0
* @access public
* @static
@ -658,7 +658,7 @@ class Net_IPv6
* @param Boolean $uncompress if true, the address will be uncompressed
* before processing
*
* @return Array [0] contains the IPv6 part,
* @return array [0] contains the IPv6 part,
* [1] the IPv4 part (hex format)
* @access public
* @static
@ -768,7 +768,7 @@ class Net_IPv6
* @param String $ipToParse the IPv6 address
* @param String $bits the optional count of netmask bits
*
* @return Array ['start', 'end'] the lowest and highest IPv6 address
* @return array ['start', 'end'] the lowest and highest IPv6 address
* @access public
* @static
* @author Nicholas Williams

View File

@ -712,6 +712,10 @@ function ldap_setup_caenv($authcfg)
putenv("LDAPTLS_CACERT=/var/run/certs/{$caref['refid']}.ca");
}
/**
* @param $name string name of the authentication system configured on the authentication server page or 'Local Database' for local authentication
* @return array|bool false if the authentication server was not found, otherwise the configuration of the authentication server
*/
function auth_get_authserver($name)
{
global $config;

View File

@ -141,9 +141,10 @@ function filter_core_get_antilockout()
/**
* recursively collect port alias(es) contents
* @param $aliasname string alias name or null to fetch all aliases
* @param $aliases aliases already parsed (prevent deadlock)
* @param string|null $aliasname alias name, or null to fetch all aliases
* @param array $aliases aliases already parsed (prevent deadlock)
* @return array containing ports
* @throws \OPNsense\Base\ModelException
*/
function filter_core_get_port_alias($aliasname, $aliases=array())
{

View File

@ -4527,7 +4527,7 @@ function is_ipaddr_configured($ipaddr, $ignore_if = '')
*/
function get_carp_interface_status($carpinterface)
{
$carp_query = '';
$carp_query = [];
/* XXX: Need to find a better way for this! */
list ($interface, $vhid) = explode("_vip", $carpinterface);

View File

@ -152,7 +152,7 @@ function legacy_move_config_list_items($source, $id, $items) {
/**
* Retrieve description text of firewall alias by specifying the alias name.
* @param string $name alias name to retrieve the description from
* @return description of alias, or null if no description was set or alias
* @return string|null description of alias, or null if no description was set or alias
* does not exist.
*/
function get_alias_description($name)

View File

@ -108,11 +108,12 @@ function step3_submitphpaction()
return;
}
$authcfg = auth_get_authserver($_POST['name']);
if (empty($_POST['name']) || empty($_POST['ip']) ||empty($_POST['transport']) ||
empty($_POST['scope']) || empty($_POST['basedn']) || empty($_POST['authscope']) || empty($_POST['nameattr'])) {
$input_errors[] = gettext('Please enter all information for authentication server.');
$stepid--;
} elseif (count(($authcfg = auth_get_authserver($_POST['name']))) > 0) {
} elseif ($authcfg !== false && count($authcfg) > 0) {
$input_errors[] = gettext('Please choose a different name because an authentication ' .
'server with this name already exists.');
$stepid--;
@ -173,10 +174,11 @@ function step5_submitphpaction()
return;
}
$authcfg = auth_get_authserver($_POST['name']);
if (empty($_POST['name']) || empty($_POST['ip']) || empty($_POST['secret'])) {
$input_errors[] = gettext('Please enter all information for authentication server.');
$stepid--;
} elseif (count(($authcfg = auth_get_authserver($_POST['name']))) > 0) {
} elseif ($authcfg !== false && count($authcfg) > 0) {
$input_errors[] = gettext('Please choose a different name because an authentication ' .
'server with this name already exists.');
$stepid--;

View File

@ -51,7 +51,7 @@
<label>Use alternate DNS-servers</label>
<type>select_multiple</type>
<style>tokenize</style>
<help><![CDATA[Type IPs of alternative DNS servers you like to use. <div class="text-info"><b>TIP: </b>You can also paste a comma seperated list into this field.</div>]]></help>
<help><![CDATA[Type IPs of alternative DNS servers you like to use. <div class="text-info"><b>TIP: </b>You can also paste a comma separated list into this field.</div>]]></help>
<hint>Type IP addresses, followed by Enter or comma.</hint>
<allownew>true</allownew>
<advanced>true</advanced>

View File

@ -197,9 +197,12 @@ class Radius extends Base implements IAuthConnector
/**
* stop radius accounting
* @param $username user name
* @param $sessionid session id
* @param $session_time total time spend on this session
* @param string $username user name
* @param string $sessionid session id
* @param int $session_time total time spent on this session
* @param $bytes_in
* @param $bytes_out
* @param $ip_address
*/
public function stopAccounting($username, $sessionid, $session_time, $bytes_in, $bytes_out, $ip_address)
{
@ -271,9 +274,12 @@ class Radius extends Base implements IAuthConnector
/**
* update radius accounting (interim update)
* @param $username user name
* @param $sessionid session id
* @param $session_time total time spend on this session
* @param string $username user name
* @param string $sessionid session id
* @param int $session_time total time spend on this session
* @param $bytes_in
* @param $bytes_out
* @param $ip_address
*/
public function updateAccounting($username, $sessionid, $session_time, $bytes_in, $bytes_out, $ip_address)
{
@ -346,8 +352,8 @@ class Radius extends Base implements IAuthConnector
/**
* authenticate user against radius
* @param $username username to authenticate
* @param $password user password
* @param string $username username to authenticate
* @param string $password user password
* @return bool authentication status
*/
public function authenticate($username, $password)

View File

@ -62,9 +62,9 @@ class Shell
/**
* execute command or list of commands
*
* @param string/Array() $command command to execute
* @param string/array $command command to execute
* @param bool $mute
* @param Array() &$output
* @param array &$output
*/
public function exec($command, $mute = false, &$output = null)
{
@ -81,7 +81,7 @@ class Shell
* execute shell command
* @param string $command command to execute
* @param bool $mute
* @param Array() &$output
* @param array &$output
* @return int
*/
private function execSingle($command, $mute = false, &$output = null)

View File

@ -51,7 +51,7 @@ abstract class Singleton
/**
* Do not clone
* @throws Exception
* @throws \Exception
*/
final private function __clone()
{

View File

@ -206,7 +206,7 @@ class Plugin
/**
* fetch anchors as text (pf ruleset part)
* @param string $types anchor types (fw for filter, other options are nat,rdr,binat. comma seperated)
* @param string $types anchor types (fw for filter, other options are nat,rdr,binat. comma separated)
* @param string $placement placement head,tail
* @return string
*/

View File

@ -61,8 +61,8 @@ class ViscosityVisz extends PlainOpenVPN
/**
* Create archive
* @param $tempdir used temp directory
* @param $content_dir full path to viscosity output files
* @param string $tempdir used temp directory
* @param string $content_dir full path to viscosity output files
* @return string full (temp)path to
*/
protected function archive($tempdir, $content_dir)

View File

@ -144,7 +144,7 @@ class Alias extends BaseModel
// find all used in this model (alias nesting)
foreach ($this->aliases->alias->iterateItems() as $alias) {
if (!in_array($alias->type, array('geoip', 'urltable'))) {
$sepchar = $alias->content->getSeperatorChar();
$sepchar = $alias->content->getSeparatorChar();
$aliases = explode($sepchar, (string)$alias->content);
if (in_array($oldname, $aliases)) {
$aliases = array_unique($aliases);

View File

@ -90,10 +90,10 @@ class AliasContentField extends BaseField
}
/**
* return seperator character used
* return separator character used
* @return string
*/
public function getSeperatorChar()
public function getSeparatorChar()
{
return $this->separatorchar;
}

View File

@ -127,7 +127,7 @@ class IDS extends BaseModel
* retrieve current altered rule status
* @param string $sid unique id
* @param string $default default value
* @return default, 0, 1 ( default, true, false)
* @return string|bool default, 0, 1 ( default, true, false)
*/
public function getRuleStatus($sid, $default)
{
@ -144,7 +144,7 @@ class IDS extends BaseModel
* @param string $sid unique id
* @param string $default default value
* @param bool $response_plain response as text ot model (select list)
* @return default, <action value> ( default, true, false)
* @return string|bool default, <action value> ( default, true, false)
*/
public function getRuleAction($sid, $default, $response_plain = false)
{

View File

@ -38,7 +38,7 @@ class Export extends BaseModel
{
/**
* get or create server to store defaults
* @param $vpnid openvpn unique reference (number)
* @param string $vpnid openvpn unique reference (number)
* @return mixed server object
*/
public function getServer($vpnid)

View File

@ -182,7 +182,7 @@ POSSIBILITY OF SUCH DAMAGE.
* @param gridId: grid id to to use
* @param url: ajax action to call
* @param state: 0/1/undefined
* @param combine: number of keys to combine (seperate with ,)
* @param combine: number of keys to combine (separate with ,)
* try to avoid too much items per call (results in too long url's)
*/
function actionToggleSelected(gridId, url, state, combine) {

View File

@ -156,7 +156,7 @@ if [ "$pkg_running" == "" ]; then
else
i=`echo $i | tr -d :`
if [ -z "$packages_downgraded" ]; then
packages_downgraded=$packages_downgraded"{\"name\":\"$i\"," # If it is the first item then we do not want a seperator
packages_downgraded=$packages_downgraded"{\"name\":\"$i\"," # If it is the first item then we do not want a separator
else
packages_downgraded=$packages_downgraded", {\"name\":\"$i\","
fi
@ -232,7 +232,7 @@ if [ "$pkg_running" == "" ]; then
# prevents leaking base / kernel advertising here
pkg_upgraded="yes"
fi
packages_upgraded=$packages_upgraded"{\"name\":\"$i\"," # If it is the first item then we do not want a seperator
packages_upgraded=$packages_upgraded"{\"name\":\"$i\"," # If it is the first item then we do not want a separator
else
packages_upgraded=$packages_upgraded", {\"name\":\"$i\","
fi
@ -283,7 +283,7 @@ if [ "$pkg_running" == "" ]; then
base_is_size="$(opnsense-update -bfSr $base_to_reboot)"
if [ "$base_to_reboot" != "$base_to_delete" -a -n "$base_is_size" ]; then
if [ "$packages_upgraded" == "" ]; then
packages_upgraded=$packages_upgraded"{\"name\":\"base\"," # If it is the first item then we do not want a seperator
packages_upgraded=$packages_upgraded"{\"name\":\"base\"," # If it is the first item then we do not want a separator
else
packages_upgraded=$packages_upgraded", {\"name\":\"base\","
fi
@ -311,7 +311,7 @@ if [ "$pkg_running" == "" ]; then
kernel_is_size="$(opnsense-update -fkSr $kernel_to_reboot)"
if [ "$kernel_to_reboot" != "$kernel_to_delete" -a -n "$kernel_is_size" ]; then
if [ "$packages_upgraded" == "" ]; then
packages_upgraded=$packages_upgraded"{\"name\":\"kernel\"," # If it is the first item then we do not want a seperator
packages_upgraded=$packages_upgraded"{\"name\":\"kernel\"," # If it is the first item then we do not want a separator
else
packages_upgraded=$packages_upgraded", {\"name\":\"kernel\","
fi

View File

@ -180,7 +180,7 @@ class DomainSorter(object):
:param mode: file open mode
"""
self._num_targets = 20
self._seperator = '|'
self._separator = '|'
self._buckets = dict()
self._sort_map = dict()
# setup target
@ -220,7 +220,7 @@ class DomainSorter(object):
"""
target = key[0]
if target in self._sort_map:
for part in (key, self._seperator, value, '\n'):
for part in (key, self._separator, value, '\n'):
self._sort_map[target].write(part)
else:
# not supposed to happen, every key should have a calculated target pool

View File

@ -63,7 +63,7 @@ function conv_log_filter($logfile, $nentries, $tail = 50, $filtertext = '', $fil
}
/* Always do a reverse tail, to be sure we're grabbing the 'end' of the log. */
$logarr = "";
$logarr = [];
exec("/usr/local/sbin/clog " . escapeshellarg($logfile) . " | grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/grep 'filterlog:' | /usr/bin/tail -r -n {$tail}", $logarr);

View File

@ -51,7 +51,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig[$fieldname] = null;
}
}
// fields containing array data (comma seperated)
// fields containing array data (comma separated)
$explode_fields = array('mtu', 'mru', 'mrru', 'bandwidth', 'localip', 'gateway', 'localip', 'subnet', 'ports');
foreach ($explode_fields as $fieldname) {
if (isset($a_ppps[$id][$fieldname])) {

View File

@ -97,7 +97,7 @@ function hook_stacked_form_tables(match)
}
}
if (children.length == 1) {
// simple seperator line, colspan = 2
// simple separator line, colspan = 2
$(this).before($(this).clone().removeAttr("id").attr('colspan', 1).addClass('hidden-sm hidden-md hidden-lg'));
$(this).addClass('hidden-xs');
} else if (children.length == 2) {

View File

@ -124,7 +124,7 @@ function is_duid($duid)
$valid_duid = true;
}
/* max DUID length is 128, but with the seperators it could be up to 254 */
/* max DUID length is 128, but with the separators it could be up to 254 */
if ($duid_length < 6 || $duid_length > 254) {
$valid_duid = false;
}

View File

@ -747,7 +747,7 @@ endif; ?>
<div class="hidden" data-for="help_for_spd">
<strong><?=gettext("Register additional Security Policy Database entries"); ?></strong><br/>
<?=gettext("Strongswan automatically creates SPD policies for the networks defined in this phase2. ".
"If you need to allow other networks to use this ipsec tunnel, you can add them here as a comma seperated list.".
"If you need to allow other networks to use this ipsec tunnel, you can add them here as a comma-separated list.".
"When configured, you can use network address translation to push packets through this tunnel from these networks."); ?><br/>
<small><?=gettext("e.g. 192.168.1.0/24, 192.168.2.0/24"); ?></small>
</div>

View File

@ -32,7 +32,7 @@ require_once("xmlrpc.inc");
/**
* do a basic authentication, uses $_SERVER['HTTP_AUTHORIZATION'] to validate user.
* @param $http_auth_header http_authorization header content
* @param string $http_auth_header content of the Authorization HTTP header
* @return bool
*/
function http_basic_auth($http_auth_header)