]> git.openstreetmap.org Git - rails.git/commitdiff
Use explicit to_unsafe_h method when converting parameters to a hash
authorTom Hughes <tom@compton.nu>
Mon, 5 Jun 2017 21:32:55 +0000 (22:32 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 5 Jun 2017 21:44:15 +0000 (22:44 +0100)
app/controllers/application_controller.rb
app/controllers/site_controller.rb

index 14490488507bc5775924d8c2e0f93a7daccf548f..89636aaa8be9c637a4e8441ec4530496073cf614 100644 (file)
@@ -74,7 +74,7 @@ class ApplicationController < ActionController::Base
     if request.cookies["_osm_session"].to_s == ""
       if params[:cookie_test].nil?
         session[:cookie_test] = true
-        redirect_to Hash[params].merge(:cookie_test => "true")
+        redirect_to params.to_unsafe_h.merge(:cookie_test => "true")
         false
       else
         flash.now[:warning] = t "application.require_cookies.cookies_needed"
index 6e26e798fa0061420860aef190e73dd46c3bb31e..5ca5c0aabcdda8202fef65b8fd51b2ca015e604d 100644 (file)
@@ -50,7 +50,7 @@ class SiteController < ApplicationController
     new_params[:anchor] = "map=#{zoom}/#{lat}/#{lon}"
     new_params[:anchor] += "&layers=#{params[:layers]}" if params.key? :layers
 
-    redirect_to Hash[new_params]
+    redirect_to new_params.to_unsafe_h
   end
 
   def key
@@ -158,7 +158,7 @@ class SiteController < ApplicationController
     end
 
     if anchor.present?
-      redirect_to Hash[params].merge(:anchor => anchor.join("&"))
+      redirect_to params.to_unsafe_h.merge(:anchor => anchor.join("&"))
     end
   end
 end