X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fgeocoding.inc.php;h=a828366dc48aefe9feafb37d9c8e2119b70ed692;hb=03bda5524bd16c5c160a314d42baefe0b3254c62;hp=e23c0acbf973376da07ca1844a843f304eb7b028;hpb=34465ab035104f739a54ec62660f04f874448627;p=platal.git diff --git a/include/geocoding.inc.php b/include/geocoding.inc.php index e23c0ac..a828366 100644 --- a/include/geocoding.inc.php +++ b/include/geocoding.inc.php @@ -47,9 +47,10 @@ abstract class Geocoder { WHERE name = {?}", $address[$area . 'Name']); if ($res->numRows() == 0) { - $address[$area . 'Id'] = XDB::execute("INSERT INTO " . $databases[$area] . " (name, country) - VALUES ({?}, {?})", - $address[$area . 'Name'], $address['countryId']); + XDB::execute('INSERT INTO ' . $databases[$area] . ' (name, country) + VALUES ({?}, {?})', + $address[$area . 'Name'], $address['countryId']); + $address[$area . 'Id'] = XDB::insertId(); } else { $address[$area . 'Id'] = $res->fetchOneCell(); } @@ -414,9 +415,9 @@ class GMapsGeocoder extends Geocoder { } if ($isPseudoCountry) { - return $address['text']; + return implode("\n", array_slice($textLines, 0, -1)); } - return implode("\n", array_slice($textLines, 0, -1)); + return $address['text']; } // Search for the lign from the given address that is the closest to the geocoded thoroughfareName