a fix for youtube urls
This commit is contained in:
parent
a3f14ed9a0
commit
a338b55a4b
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue