From a338b55a4bc8e8aa92e94b8818e5b3fde4e41c3a Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 23 Feb 2016 02:16:31 +0800 Subject: [PATCH] a fix for youtube urls --- app/models/ad_image.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/ad_image.rb b/app/models/ad_image.rb index da233b1..18141be 100644 --- a/app/models/ad_image.rb +++ b/app/models/ad_image.rb @@ -47,7 +47,7 @@ class AdImage def youtube_thumb uri = URI.parse(self.youtube) rescue nil - if !uri.nil? + if !uri.nil? && uri.host == "www.youtube.com" params = CGI.parse(uri.query) v = params['v'].first return "http://img.youtube.com/vi/#{v}/0.jpg"