From bcec2d04e6ba9915b985b4b85537a242952dfed5 Mon Sep 17 00:00:00 2001 From: maxwell <maxwell@joindiaspora.com> Date: Fri, 22 Oct 2010 15:24:46 -0700 Subject: [PATCH] do not pass in the diaspora handle query as a regex, we want to search on the string literal. also use dynamic finder --- app/models/person.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 1e063a7430..e7745c3b9b 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -97,8 +97,8 @@ class Person # Raise an error if identifier is not a valid email (generous regexp) raise "Identifier is invalid" if !(identifier =~ /\A.*\@.*\..*\Z/) - query = /#{Regexp.escape(identifier.gsub('acct:', '').to_s)}/i - local_person = Person.first(:diaspora_handle => query) + query = identifier.gsub('acct:', '').to_s + local_person = Person.find_by_diaspora_handle(:diaspora_handle => query) if local_person Rails.logger.info("Do not need to webfinger, found a local person #{local_person.real_name}") -- GitLab