- require_once 'geoloc.inc.php';
- $success = true;
- if (@$address['parsevalid'] || (@$address['text'] && @$address['changed']) || !@$address['cityid']) {
- $address = array_merge($address, empty_address());
- $new = get_address_infos(@$address['text']);
- if (compare_addresses_text(@$adress['text'], $geotxt = get_address_text($new))
- || @$address['parsevalid']) {
- $address = array_merge($address, $new);
- } else {
- $success = false;
- $address = array_merge($address, cut_address(@$address['text']));
- $address['geoloc'] = $geotxt;
- $address['geoloc_cityid'] = $new['cityid'];
- }
- }
- if (@$address['changed']) {
- $address['datemaj'] = time();
- }
- $address['text'] = get_address_text($address);
- }
-
- private function cleanAddress(ProfilePage &$page, array &$address)
- {
- if (@$address['changed']) {
- $address['datemaj'] = time();
- }
- foreach ($address['tel'] as $t=>&$tel) {
- if (@$tel['removed'] || !trim($tel['tel'])) {
- unset($address['tel'][$t]);
- } else {
- $tel['pub'] = $this->pub->value($page, 'pub', $tel['pub'], $success);
- }
- unset($tel['removed']);
- }