diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-02-15 18:46:50 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-02-15 18:46:50 +0000 |
commit | d643d9a94c658948f26686f1c0d746a6fd80cacb (patch) | |
tree | c413c6f9081d4f54f9b89d93321bf65969b8003c /app | |
parent | 3183445aea1f8df0e0b6035d1d59e87b424feaab (diff) | |
download | redmine-d643d9a94c658948f26686f1c0d746a6fd80cacb.tar.gz redmine-d643d9a94c658948f26686f1c0d746a6fd80cacb.zip |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/models/user.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 4f8223dc0..32cc08b11 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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 |