Skip to content

Commit 7ed22e1

Browse files
v2.6.7 Fixes (#800)
* fix(OpenVPNClientExporter): return empty array if no proxy traits defined #798 * style: run prettier on changed files
1 parent 1d56b3a commit 7ed22e1

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,16 @@ 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 [
381-
'ip' => $this->proxyaddr->value,
382-
'port' => $this->proxyport->value,
383-
'user' => $this->proxyuser->value,
384-
'password' => $this->proxypass->value,
385-
'proxy_type' => $this->useproxytype->value,
386-
'proxy_authtype' => $this->useproxypass->value,
387-
];
380+
return $this->useproxy->value
381+
? [
382+
'ip' => $this->proxyaddr->value,
383+
'port' => $this->proxyport->value,
384+
'user' => $this->proxyuser->value,
385+
'password' => $this->proxypass->value,
386+
'proxy_type' => $this->useproxytype->value,
387+
'proxy_authtype' => $this->useproxypass->value,
388+
]
389+
: [];
388390
}
389391

390392
private function __get_export_filename(): string {

0 commit comments

Comments
 (0)