Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix problems with safe strings #48

Closed
wants to merge 1 commit into from

2 participants

@emiltin

using gsub on safe strings doesn't work - $1, $2, are empty. to avoid this, use to_str, as well as to_s before passing to filters.

using to_str alone could be a problem, since it will not convert nil to "", but fail, so use to_s.to_str

@dejan
Owner

I can't reproduce the problem. Can you please provide a test or an example? Thanks.

@emiltin

maybe a difference between ruby 1.9 and 1.8?

@dejan
Owner

As I said, I can't reproduce the problem. Please provide failing test that this change would fix it.

@emiltin

I'll see if I can find the time. But to be clear, by safe string I mean the rails ActiveSupport::SafeBuffer http://api.rubyonrails.org/classes/ActiveSupport/SafeBuffer.html

@emiltin emiltin referenced this pull request in ibikecph/ibikecph-site
Closed

Forked gems and hacks still necessary? #4

@dejan
Owner

Closing this, since there are no steps to reproduce the issue.

@dejan dejan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/auto_html/filter.rb
View
4 lib/auto_html/filter.rb
@@ -13,9 +13,9 @@ def with(options, &block)
def apply(text, options = {})
_options = @options && @options.merge(options)
if _options
- @block.call(text.to_s.dup, _options)
+ @block.call(text.to_s.to_str.dup, _options)
else
- @block.call(text.to_s.dup)
+ @block.call(text.to_s.to_str.dup)
end
end
end
Something went wrong with that request. Please try again.