From: Tom Hughes Date: Tue, 13 Dec 2011 10:26:30 +0000 (+0000) Subject: Cope with no openid_url being supplied X-Git-Tag: live~5976 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/2fc9c8c05bfa4878d0a42d7b9238db67cee2805c Cope with no openid_url being supplied --- diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 3f5eef831..ce0122957 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -166,9 +166,10 @@ class UserController < ApplicationController @user.preferred_editor = params[:user][:preferred_editor] end - @user.openid_url = nil if params[:user][:openid_url].empty? + @user.openid_url = nil if params[:user][:openid_url].blank? - if params[:user][:openid_url].length > 0 and + if params[:user][:openid_url] and + params[:user][:openid_url].length > 0 and params[:user][:openid_url] != @user.openid_url # If the OpenID has changed, we want to check that it is a # valid OpenID and one the user has control over before saving