From 6fba0e498e2c4c52f50a0edaa908a4d7a98bcd8b Mon Sep 17 00:00:00 2001 From: cmrd Senya Date: Wed, 20 Apr 2016 13:51:31 +0300 Subject: [PATCH] Use diaspora_id validation from the federation gem DRY --- app/controllers/people_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 6277e1adf..9d5270573 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -185,7 +185,7 @@ class PeopleController < ApplicationController end def diaspora_id?(query) - !query.try(:match, /^(\w)*@([a-zA-Z0-9]|[-]|[.]|[:])*$/).nil? + !(query.nil? || query.lstrip.empty?) && Validation::Rule::DiasporaId.new.valid_value?(query) end # view this profile on the home pod, if you don't want to sign in...