Fixed: User#identity_url raises an error when invalid url is supplied (#2742).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2476 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
+8
-4
@@ -81,10 +81,14 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def identity_url=(url)
|
||||
begin
|
||||
self.write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
|
||||
rescue InvalidOpenId
|
||||
# Invlaid url, don't save
|
||||
if url.blank?
|
||||
write_attribute(:identity_url, '')
|
||||
else
|
||||
begin
|
||||
write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
|
||||
rescue OpenIdAuthentication::InvalidOpenId
|
||||
# Invlaid url, don't save
|
||||
end
|
||||
end
|
||||
self.read_attribute(:identity_url)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user