mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
php8.x - fix some deprecation warnings
This commit is contained in:
parent
9d5e1edb95
commit
a9ecea3dcd
@ -443,7 +443,7 @@ function openvpn_add_keyfile($data, &$conf, $mode_id, $directive, $opt = '')
|
||||
{
|
||||
$fpath = "/var/etc/openvpn/{$mode_id}.{$directive}";
|
||||
openvpn_create_dirs();
|
||||
$data = str_replace("\r", "", base64_decode($data));
|
||||
$data = !empty($data) ? str_replace("\r", "", base64_decode($data)) : '';
|
||||
file_put_contents($fpath, str_replace("\n\n", "\n", $data));
|
||||
@chmod($fpath, 0600);
|
||||
|
||||
@ -542,8 +542,8 @@ function openvpn_reconfigure($mode, $settings, $device_only = false)
|
||||
|
||||
// server specific settings
|
||||
if ($mode == 'server') {
|
||||
list($ip, $cidr) = explode('/', $settings['tunnel_network']);
|
||||
list($ipv6, $prefix) = explode('/', $settings['tunnel_networkv6']);
|
||||
list($ip, $cidr) = explode('/', $settings['tunnel_network'] ?? '');
|
||||
list($ipv6, $prefix) = explode('/', $settings['tunnel_networkv6'] ?? '');
|
||||
$mask = gen_subnet_mask($cidr);
|
||||
|
||||
// client connect and disconnect handling
|
||||
@ -1520,7 +1520,7 @@ function openvpn_refresh_crls()
|
||||
if (!empty($settings['crlref'])) {
|
||||
$crl = lookup_crl($settings['crlref']);
|
||||
$fpath = "/var/etc/openvpn/server{$settings['vpnid']}.crl-verify";
|
||||
file_put_contents($fpath, base64_decode($crl['text']));
|
||||
file_put_contents($fpath, !empty($crl['text']) ? base64_decode($crl['text']) : '');
|
||||
@chmod($fpath, 0644);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -110,7 +110,9 @@ function vxlan_configure_do($verbose = false, $device = null)
|
||||
$current_settings['vxlanid'] = $interfaces_details[$device_name]['vxlan']['vni'];
|
||||
$current_settings['vxlanlocal'] = explode(":", $interfaces_details[$device_name]['vxlan']['local'])[0];
|
||||
$current_settings['vxlanremote'] = explode(":", $interfaces_details[$device_name]['vxlan']['remote'])[0];
|
||||
$current_settings['vxlangroup'] = explode(":", $interfaces_details[$device_name]['vxlan']['group'])[0];
|
||||
if (!empty($interfaces_details[$device_name]['vxlan']['group'])) {
|
||||
$current_settings['vxlangroup'] = explode(":", $interfaces_details[$device_name]['vxlan']['group'])[0];
|
||||
}
|
||||
}
|
||||
// gather settings, detect changes
|
||||
$ifcnfcmd = '/sbin/ifconfig %s';
|
||||
|
||||
@ -65,7 +65,7 @@ class NetworkValidator extends BaseValidator
|
||||
foreach ($values as $value) {
|
||||
// parse filter options
|
||||
$filterOpt = 0;
|
||||
switch (strtolower($this->getOption('version'))) {
|
||||
switch (strtolower($this->getOption('version') ?? '')) {
|
||||
case "ipv4":
|
||||
$filterOpt |= FILTER_FLAG_IPV4;
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user