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/Checkboxes.php +13 -4 1.106 → 1.112 View file →
@@ -31,13 +31,22 @@
31 31
32 32 public function getValueSanitizer(): callable
33 33 {
34 34 return function ($value) {
35 - if (! is_array($value)) $value = [$value];
35 + if (! is_array($value)) {
36 + $value = [$value];
37 + }
36 38
37 - return array_filter($value, function ($item) {
38 - return array_key_exists($item, $this->options);
39 - });
39 + return array_filter(
40 + $value,
41 + function ($item) {
42 + if (! is_scalar($item)) {
43 + return false;
44 + }
45 +
46 + return array_key_exists((string) $item, $this->options);
47 + }
48 + );
40 49 };
41 50 }
42 51
43 52 public function render(): void