
Nil gsub when img with src and filter_html is on
Reported by Jason Garber | November 29th, 2010 @ 07:17 PM
Hi there.
I'm using RedCloth as part of a social network's blog system.
I came across the following bug when an img tag with the src
attribute
is inputted, and filter_html is set to true.
I have pasted the code sample below.
>> require 'RubyGems' => true >> require
'RedCloth' => true >> RedCloth.new('',[:filter_html]).to_html NoMethodError: private method
gsub' called for nil:NilClass<br/>
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1118:in
clean_html'<br/>
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1113:in
each'<br/>
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1113:in
clean_html'<br/>
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1112:in
each'<br/>
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1112:in
clean_html'<br/>
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1107:in
gsub!'<br/>
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1107:in
clean_html'<br/>
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:310:in
to_html'<br/>
from (irb):3
>>
Thanks.
Douglas F Shearer
dougal.s@gmail.com
http://douglasfshearer.com
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
RedCloth is a Ruby library for converting Textile into HTML