diff --git a/app/controllers/ad_banners_controller.rb b/app/controllers/ad_banners_controller.rb index d07bc59..d83b36c 100644 --- a/app/controllers/ad_banners_controller.rb +++ b/app/controllers/ad_banners_controller.rb @@ -22,7 +22,9 @@ class AdBannersController < ApplicationController image_link = OrbitHelper.is_mobile_view ? b.file.mobile.url : b.file.url klass = i == 0 ? "active" : "" caption = i == 0 ? '
' : "" - alt_title = (b.title.nil? || b.title == "" ? "ad-banner image" : b.title) + banner_title = b.title.to_s + banner_title_escape = banner_title.gsub('"','"') + alt_title = (banner_title_escape.blank? ? "Banner image" : banner_title_escape) if b.link_open == "new_window" target = "_blank" @@ -36,8 +38,8 @@ class AdBannersController < ApplicationController images << { "slide_number" => (i+1), "image_link" => image_link, - "image_alt" => "ad banner image", - "title" => b.title, + "image_alt" => "Banner image", + "title" => banner_title_escape, "alt_title" => alt_title, "class" => klass, "height" => adbanner.height, @@ -55,7 +57,7 @@ class AdBannersController < ApplicationController "extras" => { "ad_fx" => adbanner.ad_fx, "speed" => adbanner.speed, - "title" => adbanner.title, + "title" => adbanner.title.to_s.gsub('"','"'), "banner-height" => adbanner.height, "banner-width" => adbanner.width, "base_image" => (base_image - 1), @@ -76,7 +78,6 @@ class AdBannersController < ApplicationController adbanner.ad_images.can_display.asc(:sort_number).each_with_index do |ad_b,i| if ad_b.language_enabled.include?(I18n.locale.to_s) image_link = OrbitHelper.is_mobile_view ? ad_b.file.mobile.url : ad_b.file.url - alt_text = (ad_b.title.nil? || ad_b.title == "" ? "ad-banner image" : ad_b.title) caption = i == 0 ? '' : "" klass = i == 0 ? "active" : "" if ad_b.link_open == "new_window" @@ -85,31 +86,33 @@ class AdBannersController < ApplicationController target = "" end context = ad_b.context.tr('"',"'") rescue "" - alt_title = (ad_b.title.blank? ? "ad-banner image" : ad_b.title) + banner_title = ad_b.title.to_s + banner_title_escape = banner_title.gsub('"','"') + alt_title = (banner_title_escape.blank? ? "Banner image" : banner_title_escape) if ad_b.exchange_item == "1" image_html = " " elsif ad_b.exchange_item == "3" klass = (i == 0 ? "active" : "") video_url = ad_b.video_file.url rescue nil video_webm_url = ad_b.video_file_webm.url rescue nil @file_poster = ad_b.video_snapshot.url rescue nil - title = (ad_b.title.blank? ? File.basename(video_url) : ad_b.title) + title = (banner_title.blank? ? File.basename(video_url) : banner_title) image_html = "