Skip to content

Commit 2ea7748

Browse files
osbreadriaandotcom
authored andcommitted
Fix default boolean option bug
1 parent 146554f commit 2ea7748

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Setting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static function boolean(string $key, ?bool $default = null): ?bool
2222
{
2323
$value = get_option($key);
2424

25-
if (empty($value)) {
25+
if ($value === null || $value === '') {
2626
return $default;
2727
}
2828

src/TrackingPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function shouldCollectAnalytics(): bool
2323

2424
protected function clientIpExcluded(string $ip): bool
2525
{
26-
return in_array($ip, Setting::array(SettingName::EXCLUDED_IP_ADDRESSES), true);
26+
return in_array($ip, Setting::array(SettingName::EXCLUDED_IP_ADDRESSES));
2727
}
2828

2929
protected function containsExcludedRole(array $roles): bool

0 commit comments

Comments
 (0)