clear profile location data if unparseable location string

This commit is contained in:
Evan Prodromou 2010-01-07 15:59:07 -08:00
parent c0a062dd85
commit 6ae6fb7a35

View File

@ -316,7 +316,12 @@ class ProfilesettingsAction extends AccountSettingsAction
$loc = Location::fromName($location); $loc = Location::fromName($location);
if (!empty($loc)) { if (empty($loc)) {
$profile->lat = null;
$profile->lon = null;
$profile->location_id = null;
$profile->location_ns = null;
} else {
$profile->lat = $loc->lat; $profile->lat = $loc->lat;
$profile->lon = $loc->lon; $profile->lon = $loc->lon;
$profile->location_id = $loc->location_id; $profile->location_id = $loc->location_id;