Skip to content

Options can now be passed as html safe strings#17

Open
vlado wants to merge 2 commits intoreed:masterfrom
vlado:html_safe_options_fix
Open

Options can now be passed as html safe strings#17
vlado wants to merge 2 commits intoreed:masterfrom
vlado:html_safe_options_fix

Conversation

@vlado
Copy link
Copy Markdown

@vlado vlado commented Mar 24, 2017

If you call mail_to("me@domain.com", "My email", subject: "Example subject", encode: "javascript") in Rails 5 subject option will be
passed as ActiveSupport::SafeBuffer and not as String.
When this option reaches Rack::Utils.escape_path it will throw
NoMethodError: undefined method 'each_byte' for nil:NilClass.
This is fixed by replacing extras builder with implementation from
latest Rails which uses ERB::Util.url_encode instead of
Rack::Utils.escape_path.

vlado added 2 commits March 24, 2017 22:23
If you call `mail_to("me@domain.com", "My email", subject: "Example
subject", encode: "javascript")` in Rails 5 `subject` option will be
passed as `ActiveSupport::SafeBuffer` and not as `String`.
When this option reaches `Rack::Utils.escape_path` it will throw
`NoMethodError: undefined method 'each_byte' for nil:NilClass`.
This is fixed by replacing extras builder with implementation from
latest Rails which uses `ERB::Util.url_encode` instead of
`Rack::Utils.escape_path`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant