From f4ab0d39e948514d35932b8054ca711d685aabfd Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Wed, 3 Dec 2025 10:13:12 -0700 Subject: [PATCH 1/2] fix(OpenVPNClientExporter): return empty array if no proxy traits defined #798 --- .../usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc index 68f0a50c..106683d8 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc @@ -377,14 +377,14 @@ class OpenVPNClientExport extends Model { * @return array the proxy configuration array expected by pfSense functions */ private function __get_proxy_config(): array { - return [ + return $this->useproxy->value ? [ 'ip' => $this->proxyaddr->value, 'port' => $this->proxyport->value, 'user' => $this->proxyuser->value, 'password' => $this->proxypass->value, 'proxy_type' => $this->useproxytype->value, 'proxy_authtype' => $this->useproxypass->value, - ]; + ] : []; } private function __get_export_filename(): string { From 6c4370c191d24b0c70c40b201294165d72c1e01a Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Wed, 3 Dec 2025 15:41:06 -0700 Subject: [PATCH 2/2] style: run prettier on changed files --- .../pkg/RESTAPI/Models/OpenVPNClientExport.inc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc index 106683d8..0356f476 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc @@ -377,14 +377,16 @@ class OpenVPNClientExport extends Model { * @return array the proxy configuration array expected by pfSense functions */ private function __get_proxy_config(): array { - return $this->useproxy->value ? [ - 'ip' => $this->proxyaddr->value, - 'port' => $this->proxyport->value, - 'user' => $this->proxyuser->value, - 'password' => $this->proxypass->value, - 'proxy_type' => $this->useproxytype->value, - 'proxy_authtype' => $this->useproxypass->value, - ] : []; + return $this->useproxy->value + ? [ + 'ip' => $this->proxyaddr->value, + 'port' => $this->proxyport->value, + 'user' => $this->proxyuser->value, + 'password' => $this->proxypass->value, + 'proxy_type' => $this->useproxytype->value, + 'proxy_authtype' => $this->useproxypass->value, + ] + : []; } private function __get_export_filename(): string {