Commit e118487c authored by Robert Speicher's avatar Robert Speicher

Remove `www.` from `twitter_url` helper

Twitter redirects `www.twitter.com` to `twitter.com`

Also removes unnecessary regex escapes, just 'cause.
parent a520ab64
...@@ -300,7 +300,7 @@ module ApplicationHelper ...@@ -300,7 +300,7 @@ module ApplicationHelper
def linkedin_url(user) def linkedin_url(user)
name = user.linkedin name = user.linkedin
if name =~ %r{\Ahttps?:\/\/(www\.)?linkedin\.com\/in\/} if name =~ %r{\Ahttps?://(www\.)?linkedin\.com/in/}
name name
else else
"https://www.linkedin.com/in/#{name}" "https://www.linkedin.com/in/#{name}"
...@@ -309,10 +309,10 @@ module ApplicationHelper ...@@ -309,10 +309,10 @@ module ApplicationHelper
def twitter_url(user) def twitter_url(user)
name = user.twitter name = user.twitter
if name =~ %r{\Ahttps?:\/\/(www\.)?twitter\.com\/} if name =~ %r{\Ahttps?://(www\.)?twitter\.com/}
name name
else else
"https://www.twitter.com/#{name}" "https://twitter.com/#{name}"
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment