small fix for embeded url

This commit is contained in:
Harry Bomrah 2016-02-23 14:57:02 +08:00
parent 9fba36489e
commit d48297e36f
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class AdImage
def embed_url def embed_url
uri = URI.parse(self.youtube) rescue nil uri = URI.parse(self.youtube) rescue nil
if !uri.nil? if !uri.nil? && uri.host == "www.youtube.com"
params = CGI.parse(uri.query) params = CGI.parse(uri.query)
v = params['v'].first v = params['v'].first
return "http://www.youtube.com/embed/#{v}" return "http://www.youtube.com/embed/#{v}"