Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid 'Cannot redirect to a parameter hash' error
Rails 4 introduced a [protection against passing parameters hash into `redirect_to`](rails/rails#16170) as a security measure. In some circumstances the `session[:document_filters]` could contain a paramters hash (I suspect this may only be the case for a session which was serialized into someones session cookie in the pre-rails-4 whitehall app and deserialized in this release). Adding this `.to_h` forces the hash to always be converted to a ruby hash. It's safe to pass these parameters to redirect_to because they are all features which are intended to be controlled by user input. The redirect is just a feature to ensure consistency of urls.
- Loading branch information
0bbb477
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gah, I thought I'd fixed this one...