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+
17# v0.5.4
28
39Released 2021-08-01
Original file line number Diff line number Diff line change @@ -142,16 +142,9 @@ public function doAction()
142142 $ ingressProxyPluginStore = [];
143143 }
144144
145- $ managedFrontends = $ ingressProxyPluginStore ['managed_frontends ' ];
146- if (empty ($ managedFrontends )) {
147- $ managedFrontends = [];
148- }
149-
145+ $ managedFrontends = $ ingressProxyPluginStore ['managed_frontends ' ] ?? [];
150146 $ managedHostsPreSave = [];
151- $ managedHosts = $ store ['managed_hosts ' ];
152- if (empty ($ managedHosts )) {
153- $ managedHosts = [];
154- }
147+ $ managedHosts = $ store ['managed_hosts ' ] ?? [];
155148
156149 foreach ($ managedFrontends as $ frontendName => $ frontendDetails ) {
157150 $ primaryFrontendName = $ haProxyConfig ->getFrontend ($ frontendName )['primary_frontend ' ];
Original file line number Diff line number Diff line change @@ -56,10 +56,7 @@ public function doAction()
5656 $ store = [];
5757 }
5858
59- $ managedHosts = $ store ['managed_hosts ' ];
60- if (empty ($ managedHosts )) {
61- $ managedHosts = [];
62- }
59+ $ managedHosts = $ store ['managed_hosts ' ] ?? [];
6360
6461 // actually remove them from config
6562 $ toDeleteHosts = array_diff (@array_keys ($ managedHosts ), @array_keys ($ managedHostsPreSave ));
@@ -72,7 +69,7 @@ public function doAction()
7269
7370 if ($ dnsmasqEnabled ) {
7471 $ 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 ' ])) {
7673 $ dnsmasqConfig ->data ['hosts ' ] = [];
7774 }
7875 foreach ($ hosts as $ host ) {
@@ -90,7 +87,7 @@ public function doAction()
9087
9188 if ($ unboundEnabled ) {
9289 $ 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 ' ])) {
9491 $ unboundConfig ->data ['hosts ' ] = [];
9592 }
9693 foreach ($ hosts as $ host ) {
You can’t perform that action at this time.
0 commit comments