Skip to content

Commit

Permalink
Site Banner Fix 🏷 (#1892) (#1899)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlipeles authored May 21, 2019
1 parent 6f30b2d commit 145b0bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/site_banner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ def clear_invalid_social_links
require 'addressable'
self.social_links = social_links.select { |key, _| key.in?(["twitch", "youtube", "twitter"]) }

unless social_links["twitch"].blank? || Addressable::URI.parse(social_links["twitch"]).normalize.host.in?(["www.twitch.tv", "twitch.tv"])
unless social_links["twitch"].blank? || Addressable::URI.parse(social_links["twitch"]).to_s.starts_with?('https://www.twitch.tv/', 'https://twitch.tv/', 'www.twitch.tv/', 'twitch.tv/')
social_links["twitch"] = ""
end

unless social_links["youtube"].blank? || Addressable::URI.parse(social_links["youtube"]).normalize.host.in?(["www.youtube.com", "youtube.com"])
unless social_links["youtube"].blank? || Addressable::URI.parse(social_links["youtube"]).to_s.starts_with?('https://www.youtube.com/', 'https://youtube.com/', 'www.youtube.com/', 'youtube.com/')
social_links["youtube"] = ""
end

unless social_links["twitter"].blank? || Addressable::URI.parse(social_links["twitter"]).normalize.host.in?(["www.twitter.com", "twitter.com"])
unless social_links["twitter"].blank? || Addressable::URI.parse(social_links["twitter"]).to_s.starts_with?('https://www.twitter.com/', 'https://twitter.com/', 'www.twitter.com/', 'twitter.com/')
social_links["twitter"] = ""
end
end
Expand Down

0 comments on commit 145b0bf

Please sign in to comment.