Optimize some regex matching (#15528)
* Use Regex#match? * Replace =~ too * Avoid to call match? from Nil * Keep value of Regexp.last_match
This commit is contained in:
parent
7d0031a515
commit
eb51e43fb4
13 changed files with 20 additions and 20 deletions
|
@ -57,7 +57,7 @@ module Omniauthable
|
|||
|
||||
user = User.new(user_params_from_auth(email, auth))
|
||||
|
||||
user.account.avatar_remote_url = auth.info.image if auth.info.image =~ /\A#{URI::DEFAULT_PARSER.make_regexp(%w(http https))}\z/
|
||||
user.account.avatar_remote_url = auth.info.image if /\A#{URI::DEFAULT_PARSER.make_regexp(%w(http https))}\z/.match?(auth.info.image)
|
||||
user.skip_confirmation!
|
||||
user.save!
|
||||
user
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue