PluginProbe
Simple Analytics / 1.112
Simple Analytics v1.112
1.113 1.112 1.111 1.110 1.109 1.108 1.107 1.106 1.73 1.74 1.75 1.76 1.77 1.78 1.79 1.8 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 All 102 releases
← All changes | src/Settings/Blocks/Fields/IpList.php +2 -6 1.85 → 1.112 View file →
@@ -14,14 +14,10 @@
14 14
15 15 public function getValueSanitizer(): callable
16 16 {
17 17 return function ($value) {
18 - $ips = [];
19 -
20 - if (! is_array($value)) {
21 - $ips = explode("\n", $value);
22 - }
23 -
18 + $ips = is_array($value) ? $value : (is_string($value) ? explode("\n", $value) : []);
19 + $ips = array_filter($ips, 'is_string');
24 20 $ips = array_map('trim', $ips);
25 21 $ips = array_filter($ips, function ($ip) {
26 22 return filter_var($ip, FILTER_VALIDATE_IP) !== false;
27 23 });