From d48297e36f29be79c18203638d8899649517f4e4 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 23 Feb 2016 14:57:02 +0800 Subject: [PATCH] small fix for embeded url --- 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 18141be..b0ba05f 100644 --- a/app/models/ad_image.rb +++ b/app/models/ad_image.rb @@ -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}"