File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed
src/KubernetesPfSenseController/Plugin Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change
1
+ # v0.5.5
2
+
3
+ Released 2021-08-01
4
+
5
+ - handle more stringent type checks by php 8
6
+
1
7
# v0.5.4
2
8
3
9
Released 2021-08-01
Original file line number Diff line number Diff line change @@ -142,16 +142,9 @@ public function doAction()
142
142
$ ingressProxyPluginStore = [];
143
143
}
144
144
145
- $ managedFrontends = $ ingressProxyPluginStore ['managed_frontends ' ];
146
- if (empty ($ managedFrontends )) {
147
- $ managedFrontends = [];
148
- }
149
-
145
+ $ managedFrontends = $ ingressProxyPluginStore ['managed_frontends ' ] ?? [];
150
146
$ managedHostsPreSave = [];
151
- $ managedHosts = $ store ['managed_hosts ' ];
152
- if (empty ($ managedHosts )) {
153
- $ managedHosts = [];
154
- }
147
+ $ managedHosts = $ store ['managed_hosts ' ] ?? [];
155
148
156
149
foreach ($ managedFrontends as $ frontendName => $ frontendDetails ) {
157
150
$ primaryFrontendName = $ haProxyConfig ->getFrontend ($ frontendName )['primary_frontend ' ];
Original file line number Diff line number Diff line change @@ -56,10 +56,7 @@ public function doAction()
56
56
$ store = [];
57
57
}
58
58
59
- $ managedHosts = $ store ['managed_hosts ' ];
60
- if (empty ($ managedHosts )) {
61
- $ managedHosts = [];
62
- }
59
+ $ managedHosts = $ store ['managed_hosts ' ] ?? [];
63
60
64
61
// actually remove them from config
65
62
$ toDeleteHosts = array_diff (@array_keys ($ managedHosts ), @array_keys ($ managedHostsPreSave ));
@@ -72,7 +69,7 @@ public function doAction()
72
69
73
70
if ($ dnsmasqEnabled ) {
74
71
$ dnsmasqConfig = PfSenseConfigBlock::getRootConfigBlock ($ this ->getController ()->getRegistryItem ('pfSenseClient ' ), 'dnsmasq ' );
75
- if (!is_array ($ dnsmasqConfig ->data ['hosts ' ])) {
72
+ if (!isset ( $ dnsmasqConfig -> data [ ' hosts ' ]) || ! is_array ($ dnsmasqConfig ->data ['hosts ' ])) {
76
73
$ dnsmasqConfig ->data ['hosts ' ] = [];
77
74
}
78
75
foreach ($ hosts as $ host ) {
@@ -90,7 +87,7 @@ public function doAction()
90
87
91
88
if ($ unboundEnabled ) {
92
89
$ unboundConfig = PfSenseConfigBlock::getRootConfigBlock ($ this ->getController ()->getRegistryItem ('pfSenseClient ' ), 'unbound ' );
93
- if (!is_array ($ unboundConfig ->data ['hosts ' ])) {
90
+ if (!isset ( $ unboundConfig -> data [ ' hosts ' ]) || ! is_array ($ unboundConfig ->data ['hosts ' ])) {
94
91
$ unboundConfig ->data ['hosts ' ] = [];
95
92
}
96
93
foreach ($ hosts as $ host ) {
You can’t perform that action at this time.
0 commit comments