From 4b4e04b7785d6ef49120d8c6425aaca4e2c2651d Mon Sep 17 00:00:00 2001 From: Philipp Ullmann Date: Thu, 7 Feb 2013 09:06:22 +0100 Subject: [PATCH] Fixed token key regex issue --- app/models/token.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/token.rb b/app/models/token.rb index 4c0598e60d6..915fcbae7be 100644 --- a/app/models/token.rb +++ b/app/models/token.rb @@ -41,7 +41,7 @@ def self.destroy_expired def self.find_active_user(action, key, validity_days=nil) action = action.to_s key = key.to_s - return nil unless action.present? && key =~ /\A[a-f0-9]+\z/ + return nil unless action.present? && !key.match('\A[a-zA-Z0-9]+\Z').nil? token = find_by_action_and_value(action, key) if token && token.user && token.user.active?