incubator-heraldry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From record...@apache.org
Subject svn commit: r504360 - /incubator/heraldry/idp/pip/trunk/app/helpers/account_helper.rb
Date Tue, 06 Feb 2007 23:14:41 GMT
Author: recordond
Date: Tue Feb  6 15:14:40 2007
New Revision: 504360

URL: http://svn.apache.org/viewvc?view=rev&rev=504360
Log:
Fix regex to work with https URLs and check that 'login' isn't nil so we don't get application
errors

Modified:
    incubator/heraldry/idp/pip/trunk/app/helpers/account_helper.rb

Modified: incubator/heraldry/idp/pip/trunk/app/helpers/account_helper.rb
URL: http://svn.apache.org/viewvc/incubator/heraldry/idp/pip/trunk/app/helpers/account_helper.rb?view=diff&rev=504360&r1=504359&r2=504360
==============================================================================
--- incubator/heraldry/idp/pip/trunk/app/helpers/account_helper.rb (original)
+++ incubator/heraldry/idp/pip/trunk/app/helpers/account_helper.rb Tue Feb  6 15:14:40 2007
@@ -61,9 +61,9 @@
   end
 
   def get_login_from_domain(url)
-    url =~ %r[http://(([\w-]+\.){0,2}[\w-]+)]
+    url =~ %r[https?://(([\w-]+\.){0,2}[\w-]+)]
     login = $1
-    if url && APP_CONFIG[:restricted_names].include?(login.split('.').last)
+    if url && login && APP_CONFIG[:restricted_names].include?(login.split('.').last)
       login
     else
       nil



Mime
View raw message