From: Brion Vibber Date: Thu, 19 Nov 2009 01:36:55 +0000 (-0800) Subject: Check profile->update() result against false exactly; we may legitimately get 0 back... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f7a3e508ba8d0f8f9487724f3e417554d1d0b4d8;p=quix0rs-gnu-social.git Check profile->update() result against false exactly; we may legitimately get 0 back if no rows were changed. DB objects normally would return true, but the comparisons aren't 100% reliable when we've got numbers which could be ints or strings or floats. Caused failures saving profile settings with Geonames plugin enabled; the lat/lon/id fields would get re-set with freshly looked up values which no longer matched the previous values as far as the data object could tell, but which saved as the same ol' numbers. --- diff --git a/actions/profilesettings.php b/actions/profilesettings.php index 0a0cc59973..359664096e 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -323,7 +323,7 @@ class ProfilesettingsAction extends AccountSettingsAction $result = $profile->update($orig_profile); - if (!$result) { + if ($result === false) { common_log_db_error($profile, 'UPDATE', __FILE__); $this->serverError(_('Couldn\'t save profile.')); return;