]> git.openstreetmap.org Git - rails.git/commitdiff
Use safe_join to join social sharing buttons
authorTom Hughes <tom@compton.nu>
Wed, 18 Dec 2024 17:08:04 +0000 (17:08 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 19 Dec 2024 08:16:58 +0000 (08:16 +0000)
app/helpers/social_share_button_helper.rb

index 90618a9245662a3975fee24f114f06ddd963d170..da49347c3054a56f32a063e54cb44faf84bc2e79 100644 (file)
@@ -16,7 +16,7 @@ module SocialShareButtonHelper
     tag.div(
       :class => "social-share-button d-flex gap-1 align-items-end flex-wrap mb-3"
     ) do
-      SOCIAL_SHARE_CONFIG.map do |site, icon|
+      safe_join(SOCIAL_SHARE_CONFIG.map do |site, icon|
         link_options = {
           :rel => "nofollow",
           :class => "ssb-icon rounded-circle",
@@ -27,7 +27,7 @@ module SocialShareButtonHelper
         link_to generate_share_url(site, title, url), link_options do
           image_tag(icon, :alt => I18n.t("application.share.#{site}.alt"), :size => 28)
         end
-      end.join.html_safe
+      end, "\n")
     end
   end