Skip to content

Commit f9c3158

Browse files
Fixed conditional code
1 parent 10cdbf8 commit f9c3158

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

includes/class-wc-geolocation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public static function geolocate_ip( $ip_address = '', $fallback = false, $api_f
164164
$geolocation = apply_filters(
165165
'woocommerce_get_geolocation',
166166
array(
167-
'country' => $country_code ? $country_code : '',
167+
'country' => $country_code,
168168
'state' => '',
169169
'city' => '',
170170
'postcode' => '',
@@ -173,13 +173,13 @@ public static function geolocate_ip( $ip_address = '', $fallback = false, $api_f
173173
);
174174

175175
// If we still haven't found a country code, let's consider doing an API lookup.
176-
if ( false === $geolocation['country'] && $api_fallback ) {
176+
if ( '' === $geolocation['country'] && $api_fallback ) {
177177
$geolocation['country'] = self::geolocate_via_api( $ip_address );
178178
}
179179

180180
// It's possible that we're in a local environment, in which case the geolocation needs to be done from the
181181
// external address.
182-
if ( false === $geolocation['country'] && $fallback ) {
182+
if ( '' === $geolocation['country'] && $fallback ) {
183183
$external_ip_address = self::get_external_ip_address();
184184

185185
// Only bother with this if the external IP differs.

0 commit comments

Comments
 (0)