small fix for embeded url

This commit is contained in:
harrybomrah committed 2016-02-23 14:57:02 +08:00
1 parent 9fba36489e
commit d48297e36f
1 file changed
+1 -1
+1 -1
View File
@@ -36,7 +36,7 @@ class AdImage
def embed_url
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://www.youtube.com/embed/#{v}"