Test Failed
Push — master ( a0f007...5e22d4 )
by Stiofan
15:04
created
geodirectory-functions/location_functions.php 1 patch
Braces   +29 added lines, -21 removed lines patch added patch discarded remove patch
@@ -61,11 +61,12 @@  discard block
 block discarded – undo
61 61
 function geodir_is_default_location_set()
62 62
 {
63 63
     $default_location = geodir_get_default_location();
64
-    if (!empty($default_location))
65
-        return true;
66
-    else
67
-        return false;
68
-}
64
+    if (!empty($default_location)) {
65
+            return true;
66
+    } else {
67
+            return false;
68
+    }
69
+    }
69 70
 
70 71
 /**
71 72
  * Returns location slug using location string.
@@ -259,8 +260,9 @@  discard block
 block discarded – undo
259 260
         }
260 261
         */
261 262
 
262
-        if ($geodir_location->is_default)
263
-            update_option('geodir_default_location', $geodir_location);
263
+        if ($geodir_location->is_default) {
264
+                    update_option('geodir_default_location', $geodir_location);
265
+        }
264 266
 
265 267
         return $geodir_location->location_id;
266 268
 
@@ -305,7 +307,7 @@  discard block
 block discarded – undo
305 307
 
306 308
     if(isset($result->results[0]->address_components)){
307 309
         return $result->results[0]->address_components;
308
-    }else{
310
+    } else{
309 311
         return false;
310 312
     }
311 313
 }
@@ -332,16 +334,19 @@  discard block
 block discarded – undo
332 334
         }
333 335
 
334 336
         $country = isset($_REQUEST['gd_country']) ? $_REQUEST['gd_country'] : $gd_session->get('gd_country');
335
-        if ($country != '' && $country)
336
-            $location_array['gd_country'] = urldecode($country);
337
+        if ($country != '' && $country) {
338
+                    $location_array['gd_country'] = urldecode($country);
339
+        }
337 340
 
338 341
         $region = isset($_REQUEST['gd_region']) ? $_REQUEST['gd_region'] : $gd_session->get('gd_region');
339
-        if ($region != '' && $region)
340
-            $location_array['gd_region'] = urldecode($region);
342
+        if ($region != '' && $region) {
343
+                    $location_array['gd_region'] = urldecode($region);
344
+        }
341 345
 
342 346
         $city = isset($_REQUEST['gd_city']) ? $_REQUEST['gd_city'] : $gd_session->get('gd_city');
343
-        if ($city != '' && $city)
344
-            $location_array['gd_city'] = urldecode($city);
347
+        if ($city != '' && $city) {
348
+                    $location_array['gd_city'] = urldecode($city);
349
+        }
345 350
     } else {
346 351
         if ((isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] == 'me') || (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] == 'me') || (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] == 'me')) {
347 352
             return $location_array;
@@ -353,14 +358,17 @@  discard block
 block discarded – undo
353 358
 
354 359
         $city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
355 360
 
356
-        if ($country != '')
357
-            $location_array['gd_country'] = urldecode($country);
361
+        if ($country != '') {
362
+                    $location_array['gd_country'] = urldecode($country);
363
+        }
358 364
 
359
-        if ($region != '')
360
-            $location_array['gd_region'] = urldecode($region);
365
+        if ($region != '') {
366
+                    $location_array['gd_region'] = urldecode($region);
367
+        }
361 368
 
362
-        if ($city != '')
363
-            $location_array['gd_city'] = urldecode($city);
369
+        if ($city != '') {
370
+                    $location_array['gd_city'] = urldecode($city);
371
+        }
364 372
 			
365 373
 		// Fix category link in ajax popular category widget on change post type
366 374
 		if (empty($location_array) && defined('DOING_AJAX') && DOING_AJAX) {
@@ -452,7 +460,7 @@  discard block
 block discarded – undo
452 460
         $result->formatted_address = !empty($formatted_address) ? implode(', ', $formatted_address) : '';
453 461
 
454 462
         return $result;
455
-    }else{
463
+    } else{
456 464
         return false;
457 465
     }
458 466
 }
Please login to merge, or discard this patch.