This project is archived and is in readonly mode.

#6557 new
Andrew

Symbol duplication error in ParameterFilter compiled_filter

Reported by Andrew | March 10th, 2011 @ 10:01 PM

I'm using Rails 3.0.3, and I'm having a problem with passing a block to filter_parameters in application.rb. If I pass a block, an error occurs on line 38 of ActionDispatch::Http::ParameterFilter.compiled_filter:
key = key.dup
when key is a symbol. This happens because symbols are not duplicable. Here is the source:

def compiled_filter
    ...
    elsif blocks.present?
        key = key.dup
        value = value.dup if value.duplicable?
        blocks.each { |b| b.call(key, value) }
    end
    ...
end

I'm not sure why there isn't a duplicable? check on key before dup is called, but if I add that my problem is resolved. I'm wondering if that is a safe change to make. I am worried that the original author left that out intentionally.

The symbol that causes the error is :action, and it occurs whenever an error-email is being processed (using the exception-notifier gem).

No comments found

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages