app/controllers/resolve_controller.rb in umlaut-3.0.0 vs app/controllers/resolve_controller.rb in umlaut-3.0.1

- old
+ new

@@ -3,10 +3,13 @@ # parameter umlaut.request_id=[some id] to hook up to a pre-existing # umlaut request (that presumably was an OpenURL). class ResolveController < UmlautController + + + before_filter :init_processing # Init processing will look at this list, and for actions mentioned, # will not create a @user_request if an existing one can't be found. # Used for actions meant only to deal with existing requests. @@no_create_request_actions = ['background_update'] @@ -148,9 +151,16 @@ # intentionally trigger creation of session if it didn't already exist # because we need to track session ID for caching. Can't find any # way to force session creation without setting a value in session, # so we do this weird one. session[nil] = nil + + # We have to clean the params of bad char encoding bytes, or it causes + # no end of problems later. We can't just refuse to process, sources + # do send us bad bytes, I'm afraid. + params.values.each do |v| + EnsureValidEncoding.ensure_valid_encoding!(v, :invalid => :replace) + end # Create an UmlautRequest object. options = {} if ( @@no_create_request_actions.include?(params[:action]) ) options[:allow_create] = false