From 77877c7e3c23d919e8387f5a98da69458b59d224 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 24 Apr 2014 10:00:02 -0400 Subject: Avoid a PHP error in OpenVPN client export if the user chooses one of the automatic port forward methods but has no port forwards defined. --- config/openvpn-client-export/openvpn-client-export.inc | 3 +++ config/openvpn-client-export/openvpn-client-export.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc index 87475be5..91b8f198 100755 --- a/config/openvpn-client-export/openvpn-client-export.inc +++ b/config/openvpn-client-export/openvpn-client-export.inc @@ -867,6 +867,9 @@ function openvpn_client_export_find_port_forwards($targetip, $targetport, $targe filter_generate_optcfg_array(); $destinations = array(); + if (!is_array($config['nat']) || !is_array($config['nat']['rule'])) + return $destinations; + foreach ($config['nat']['rule'] as $natent) { $dest = array(); if (!isset($natent['disabled']) diff --git a/config/openvpn-client-export/openvpn-client-export.xml b/config/openvpn-client-export/openvpn-client-export.xml index f8513387..5aec33c1 100755 --- a/config/openvpn-client-export/openvpn-client-export.xml +++ b/config/openvpn-client-export/openvpn-client-export.xml @@ -1,7 +1,7 @@ OpenVPN Client Export - 1.2.4 + 1.2.7 OpenVPN Client Export /usr/local/pkg/openvpn-client-export.inc -- cgit v1.2.3