Permalink
Browse files

Removing raw calls

  • Loading branch information...
1 parent 72e9bec commit ec82d85dacad3879ae4462a2e13106c395903622 @kirs kirs committed Jan 21, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/crummy/standard_renderer.rb
View
5 lib/crummy/standard_renderer.rb
@@ -3,7 +3,6 @@
module Crummy
class StandardRenderer
include ActionView::Helpers::UrlHelper
- include ActionView::Helpers::OutputSafetyHelper
include ActionView::Helpers::TagHelper unless self.included_modules.include?(ActionView::Helpers::TagHelper)
# Render the list of crumbs as either html or xml
@@ -55,7 +54,7 @@ def render_crumbs(crumbs, options = {})
crumb_string = crumbs.collect do |crumb|
crumb_to_html_list(crumb, options[:links], options[:li_class], options[:active_li_class], options[:first_class], options[:last_class], (crumb == crumbs.first), (crumb == crumbs.last))
end * options[:separator]
- crumb_string = content_tag(:ul, raw(crumb_string), :class => options[:ul_class], :id => options[:ul_id])
+ crumb_string = content_tag(:ul, crumb_string, :class => options[:ul_class], :id => options[:ul_id])
crumb_string
when :xml
crumbs.collect do |crumb|
@@ -88,7 +87,7 @@ def crumb_to_html_list(crumb, links, li_class, active_li_class, first_class, las
def crumb_to_xml(crumb, links, separator, is_first, is_last)
name, url = crumb
- raw content_tag(separator, name, :href => (url && links ? url : nil))
+ content_tag(separator, name, :href => (url && links ? url : nil))
end
end
end

2 comments on commit ec82d85

@fotos

This change broke both the :html_list functionality and a test.

The problem is that the * operator on line 56 performs a join on the Array, returned by the collect block, which in turn returns a new String (which is not html_safe).

Please also see: http://stackoverflow.com/questions/7562478/nested-content-tags-escape-inner-html-why

@kirs

I see your patch, thanks!

Please sign in to comment.