Skip to content

Commit 9472b2d

Browse files
fix(OpenVPNClientExporter): return empty array if no proxy traits defined #798
1 parent 88b5d7d commit 9472b2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/OpenVPNClientExport.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,14 @@ class OpenVPNClientExport extends Model {
377377
* @return array the proxy configuration array expected by pfSense functions
378378
*/
379379
private function __get_proxy_config(): array {
380-
return [
380+
return $this->useproxy->value ? [
381381
'ip' => $this->proxyaddr->value,
382382
'port' => $this->proxyport->value,
383383
'user' => $this->proxyuser->value,
384384
'password' => $this->proxypass->value,
385385
'proxy_type' => $this->useproxytype->value,
386386
'proxy_authtype' => $this->useproxypass->value,
387-
];
387+
] : [];
388388
}
389389

390390
private function __get_export_filename(): string {

0 commit comments

Comments
 (0)