]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/profilesettings.php
Merge branch 'master' of gitorious.org:statusnet/mainline
[quix0rs-gnu-social.git] / actions / profilesettings.php
index ee236fe62503ec3b3cd7adf5af58e813a3605713..161e35b111f450ed7ce14ef5d3e94f79bac9e0f3 100644 (file)
@@ -285,6 +285,10 @@ class ProfilesettingsAction extends AccountSettingsAction
                 } else {
                     // Re-initialize language environment if it changed
                     common_init_language();
+                    // Clear the site owner, in case nickname changed
+                    if ($user->hasRole(Profile_role::OWNER)) {
+                        User::blow('user:site_owner');
+                    }
                 }
             }
 
@@ -316,7 +320,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;