]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/profilesettings.php
clear profile location data if unparseable location string
[quix0rs-gnu-social.git] / actions / profilesettings.php
index ee236fe62503ec3b3cd7adf5af58e813a3605713..0d6777879193af2e9d66e662a3737ebd396fc062 100644 (file)
@@ -316,7 +316,12 @@ class ProfilesettingsAction extends AccountSettingsAction
 
             $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->lon         = $loc->lon;
                 $profile->location_id = $loc->location_id;