From f7a3e508ba8d0f8f9487724f3e417554d1d0b4d8 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 18 Nov 2009 17:36:55 -0800 Subject: [PATCH] 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. --- actions/profilesettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5