Skip to content

Commit f510233

Browse files
authored
Update CheckHost.php
1 parent b470a5d commit f510233

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/CheckHost.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ public function updateNodes(): bool {
8585
* @return bool
8686
*/
8787
public function setCountry(array|null $countries = null, bool $except = false): bool {
88-
if (is_null($countries)) {
88+
if (empty($countries)) {
8989
$countries_list = [];
9090
}
9191
else {
9292
$countries_list = array_map('strtolower', $countries);
9393
}
94-
$this->selected_countries = $countries;
94+
$this->selected_countries = $countries_list;
9595

9696
$ch = curl_init('https://check-host.net/nodes/hosts');
9797
$response = json_decode($this->getResponse($ch), true);
@@ -108,7 +108,7 @@ public function setCountry(array|null $countries = null, bool $except = false):
108108
$country_code = strtolower($info['location'][0]);
109109
$country_name = strtolower($info['location'][1]);
110110

111-
if (is_null($countries)) {
111+
if (empty($countries_list)) {
112112
$match = true;
113113
}
114114
else {

0 commit comments

Comments
 (0)