diff --git a/src/etc/inc/IPv6.inc b/src/etc/inc/IPv6.inc index 3d9d891b9..22a6824f3 100644 --- a/src/etc/inc/IPv6.inc +++ b/src/etc/inc/IPv6.inc @@ -657,7 +657,7 @@ class Net_IPv6 */ function isCompressible($ip) { - return (bool)($ip != Net_IPv6::compress($address)); + return (bool)($ip != Net_IPv6::compress($ip)); } // }}} diff --git a/src/etc/inc/auth.inc b/src/etc/inc/auth.inc index 979921fd7..7298f1f19 100644 --- a/src/etc/inc/auth.inc +++ b/src/etc/inc/auth.inc @@ -801,7 +801,7 @@ function authenticate_user($username, $password, $authcfg = NULL) if ($authenticator != null) { return $authenticator->authenticate($username, $password) ; } else { - log_error('Unable to retrieve authenticator for '. $authName); + log_error('Unable to retrieve authenticator for '. $username); return false; } } diff --git a/src/etc/inc/certs.inc b/src/etc/inc/certs.inc index dfa071d60..e6cdee55a 100644 --- a/src/etc/inc/certs.inc +++ b/src/etc/inc/certs.inc @@ -317,6 +317,7 @@ function cert_get_subject($str_crt, $decode = true) } ksort($components); + $subject = ''; foreach ($components as $a => $v) { if (is_array($v)) { ksort($v); @@ -365,6 +366,7 @@ function cert_get_issuer($str_crt, $decode = true) return "unknown"; } ksort($components); + $issuer = ''; foreach ($components as $a => $v) { if (is_array($v)) { ksort($v); diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index 7d2694de8..438dc0104 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -601,7 +601,7 @@ function filter_generate_scrubing(&$FilterIflist) function filter_generate_aliases() { - $aliases .= "\n# Lockout tables\n"; + $aliases = "\n# Lockout tables\n"; $aliases .= "table persist\n"; $aliases .= "table persist\n"; diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 848b7e113..bc9b63548 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -2019,7 +2019,7 @@ function interface_wireless_configure($if, &$wl, &$wlcfg) switch ($wlcfg['mode']) { case 'bss': if (isset($wlcfg['wpa']['enable'])) { - $wpa .= <<fetchUserDNs(); } - if ($authObject != null) { + if (isset($authObject)) { $props = $servers[$authserver]; // when a local user exist and has a different (distinguished) name on the authenticator we already // know of, we send the mapping to the authenticator as property "local_users". diff --git a/src/opnsense/mvc/app/library/OPNsense/Auth/LDAP.php b/src/opnsense/mvc/app/library/OPNsense/Auth/LDAP.php index 343b46b6a..3e54ec134 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Auth/LDAP.php +++ b/src/opnsense/mvc/app/library/OPNsense/Auth/LDAP.php @@ -402,7 +402,7 @@ class LDAP extends Base implements IAuthConnector if ($ldap_is_connected) { $this->lastAuthProperties['dn'] = $user_dn; if ($this->ldapReadProperties) { - $sr = @ldap_read($this->ldapHandle, $userdn, '(objectclass=*)'); + $sr = @ldap_read($this->ldapHandle, $user_dn, '(objectclass=*)'); $info = @ldap_get_entries($this->ldapHandle, $sr); if ($info['count'] != 0) { // $this->lastAuthProperties['info'] = $info[0]; diff --git a/src/opnsense/mvc/app/library/OPNsense/OpenVPN/BaseExporter.php b/src/opnsense/mvc/app/library/OPNsense/OpenVPN/BaseExporter.php index 0bd7addb6..14c3c5e06 100644 --- a/src/opnsense/mvc/app/library/OPNsense/OpenVPN/BaseExporter.php +++ b/src/opnsense/mvc/app/library/OPNsense/OpenVPN/BaseExporter.php @@ -59,6 +59,7 @@ abstract class BaseExporter $p12 = null; $crt = openssl_x509_read($crt); $prv = openssl_get_privatekey($prv); + $args = []; if ($cas !== null) { $args = [ 'extracerts' => $cas diff --git a/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php b/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php index 04802d391..41de32ead 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php +++ b/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php @@ -362,8 +362,8 @@ abstract class BaseField /** * Set attribute on Field object - * @param $key attribute key - * @param $value attribute value + * @param string $key attribute key + * @param string $value attribute value */ public function setAttributeValue($key, $value) { diff --git a/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.php b/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.php index d0f83d7ce..282e558eb 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.php +++ b/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.php @@ -101,7 +101,7 @@ class Alias extends BaseModel /** * Return all places an alias seems to be used - * @param $name alias name + * @param string $name alias name * @return array hashmap with references where this alias is used */ public function whereUsed($name) diff --git a/src/www/diag_confbak.php b/src/www/diag_confbak.php index e2f9f5025..b32e957ce 100644 --- a/src/www/diag_confbak.php +++ b/src/www/diag_confbak.php @@ -226,7 +226,7 @@ include("fbegin.inc"); - 0) { print gettext('Current space used:') . ' ' . exec("/usr/bin/du -sh /conf/backup | /usr/bin/awk '{print $1;}'"); } ?> diff --git a/src/www/diag_dump_states.php b/src/www/diag_dump_states.php index ef216cc9e..feeb9efd2 100644 --- a/src/www/diag_dump_states.php +++ b/src/www/diag_dump_states.php @@ -162,7 +162,6 @@ include("head.inc"); diff --git a/src/www/diag_limiter_info.php b/src/www/diag_limiter_info.php index 9d8bcb43a..48f363132 100644 --- a/src/www/diag_limiter_info.php +++ b/src/www/diag_limiter_info.php @@ -82,7 +82,7 @@ include("head.inc");
"; print_info_box($savemsg); echo "
"; diff --git a/src/www/interfaces.php b/src/www/interfaces.php index c7e088372..6cd6629a5 100644 --- a/src/www/interfaces.php +++ b/src/www/interfaces.php @@ -761,8 +761,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $input_errors[] = gettext('6RD IPv4 prefix length must be a number.'); } foreach ($ifdescrs as $ifent => $unused) { - if ($if != $ifent && ($config[interfaces][$ifent]['ipaddrv6'] == $pconfig['type6'])) { - if ($config[interfaces][$ifent]['prefix-6rd'] == $pconfig['prefix-6rd']) { + if ($if != $ifent && ($config['interfaces'][$ifent]['ipaddrv6'] == $pconfig['type6'])) { + if ($config['interfaces'][$ifent]['prefix-6rd'] == $pconfig['prefix-6rd']) { $input_errors[] = gettext("You can only have one interface configured in 6rd with same prefix."); break; } @@ -771,7 +771,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { break; case "6to4": foreach ($ifdescrs as $ifent => $unused) { - if ($if != $ifent && ($config[interfaces][$ifent]['ipaddrv6'] == $pconfig['type6'])) { + if ($if != $ifent && ($config['interfaces'][$ifent]['ipaddrv6'] == $pconfig['type6'])) { $input_errors[] = sprintf(gettext("You can only have one interface configured as 6to4."), $pconfig['type6']); break; } @@ -1351,9 +1351,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $send_options = array(); $send_options = create_OR_FR_Credentials($pconfig['rfc3118_username'], $pconfig['rfc3118_password'], $pconfig['rfc3118_or_fr_lbid']); log_error("send options dhcp4 = {$send_options[1]}"); - $new_config[adv_dhcp_send_options] = $pconfig[adv_dhcp_send_options] = $send_options['dhcp4_send_options']; - $new_config[adv_dhcp_request_options] = $pconfig[adv_dhcp_request_options] = $send_options['dhcp4_request_options']; - $new_config[adv_dhcp6_interface_statement_send_options] = $pconfig[adv_dhcp6_interface_statement_send_options] = $send_options['dhcp6_send_options']; + $new_config['adv_dhcp_send_options'] = $pconfig['adv_dhcp_send_options'] = $send_options['dhcp4_send_options']; + $new_config['adv_dhcp_request_options'] = $pconfig['adv_dhcp_request_options'] = $send_options['dhcp4_request_options']; + $new_config['adv_dhcp6_interface_statement_send_options'] = $pconfig['adv_dhcp6_interface_statement_send_options'] = $send_options['dhcp6_send_options']; } } } diff --git a/src/www/system_advanced_network.php b/src/www/system_advanced_network.php index 445e313fa..f46a50128 100644 --- a/src/www/system_advanced_network.php +++ b/src/www/system_advanced_network.php @@ -44,6 +44,7 @@ function get_mac_address() function generate_new_duid($duid_type) { + $new_duid = ''; switch ($duid_type) { case '1': //LLT $mac = get_mac_address(); @@ -53,7 +54,7 @@ function generate_new_duid($duid_type) $timestamp_array = str_split($timestamp,2); $timestamp = implode(":",$timestamp_array); $type = "\x00\x01\x00\x01"; - while ($count < strlen($type)) { + for ($count = 0; $count < strlen($type); ) { $new_duid .= bin2hex( $type[$count]); $count++; if ($count < strlen($type)) { @@ -69,7 +70,7 @@ function generate_new_duid($duid_type) $timestamp_array = str_split($timestamp,2); $timestamp = implode(":",$timestamp_array); $type = "\x00\x03\x00\x01"; - while ($count < strlen($type)) { + for ($count = 0; $count < strlen($type); ) { $new_duid .= bin2hex( $type[$count]); $count++; if ($count < strlen($type)) { @@ -80,7 +81,7 @@ function generate_new_duid($duid_type) break; case '3': //UUID $type = "\x00\x00\x00\x04".openssl_random_pseudo_bytes(16); - while ($count < strlen($type)) { + for ($count = 0; $count < strlen($type); ) { $new_duid .= bin2hex( $type[$count]); $count++; if ($count < strlen($type)) { diff --git a/src/www/wizard.php b/src/www/wizard.php index bebb5c5e1..f4b7909d8 100644 --- a/src/www/wizard.php +++ b/src/www/wizard.php @@ -172,6 +172,7 @@ $extraBreadcrumb = $pkg['step'][$stepid]['title']; function update_config_field($field, $updatetext, $unset, $arraynum, $field_type) { global $config; $field_split = explode("->",$field); + $field_conv = ''; foreach ($field_split as $f) $field_conv .= "['" . $f . "']"; if($field_conv == "") @@ -208,6 +209,7 @@ function update_config_field($field, $updatetext, $unset, $arraynum, $field_type function redirect_url() { global $config, $title; + $urlport = ''; switch($config['system']['webgui']['protocol']) { case "http": @@ -226,8 +228,6 @@ function redirect_url() $urlport = ":" . $port; } elseif ($port != "80" and $port != "443") { $urlport = ":" . $port; - } else { - $urlport = ""; } } $http_host = $_SERVER['SERVER_NAME'];