Code Duplication    Length = 31-31 lines in 2 locations

geodirectory-functions/general_functions.php 2 locations

@@ 4070-4100 (lines=31) @@
4067
        $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4068
    }
4069
4070
    if ($gd_city != '') {
4071
        if ($gd_city_actual != '') {
4072
            $gd_city = $gd_city_actual;
4073
        } else {
4074
            $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4075
            $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4076
            $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4077
        }
4078
        $location_single = $gd_city;
4079
4080
    } else if ($gd_region != '') {
4081
        if ($gd_region_actual != '') {
4082
            $gd_region = $gd_region_actual;
4083
        } else {
4084
            $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4085
            $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4086
            $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4087
        }
4088
4089
        $location_single = $gd_region;
4090
    } else if ($gd_country != '') {
4091
        if ($gd_country_actual != '') {
4092
            $gd_country = $gd_country_actual;
4093
        } else {
4094
            $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4095
            $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4096
            $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4097
        }
4098
4099
        $location_single = $gd_country;
4100
    }
4101
4102
    if (!empty($location_array)) {
4103
@@ 4361-4391 (lines=31) @@
4358
        $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4359
    }
4360
4361
    if ($gd_city != '') {
4362
        if ($gd_city_actual != '') {
4363
            $gd_city = $gd_city_actual;
4364
        } else {
4365
            $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4366
            $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4367
            $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4368
        }
4369
        $location_single = $gd_city;
4370
4371
    } else if ($gd_region != '') {
4372
        if ($gd_region_actual != '') {
4373
            $gd_region = $gd_region_actual;
4374
        } else {
4375
            $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4376
            $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4377
            $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4378
        }
4379
4380
        $location_single = $gd_region;
4381
    } else if ($gd_country != '') {
4382
        if ($gd_country_actual != '') {
4383
            $gd_country = $gd_country_actual;
4384
        } else {
4385
            $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4386
            $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4387
            $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4388
        }
4389
4390
        $location_single = $gd_country;
4391
    }
4392
4393
    if (!empty($location_array)) {
4394