]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/search_controller.rb
Remove unused parameter
[rails.git] / app / controllers / search_controller.rb
index 210e0811b34a232daebf3d5db44f09276b4488b8..78becc24b485f7be4bc000fd9ce7fdd05145d9b0 100644 (file)
@@ -2,6 +2,7 @@ class SearchController < ApplicationController
   # Support searching for nodes, ways, or all
   # Can search by tag k, v, or both (type->k,value->v)
   # Can search by name (k=name,v=....)
+  skip_before_filter :verify_authenticity_token
   after_filter :compress_output
 
   def search_all
@@ -47,6 +48,8 @@ class SearchController < ApplicationController
       nodes = nodes.where(:current_node_tags => { :k => type }) if type
       nodes = nodes.where(:current_node_tags => { :v => value }) if value
       nodes = nodes.limit(100)
+    else
+      nodes = Array.new
     end
 
     # Matching for way tags table
@@ -55,6 +58,8 @@ class SearchController < ApplicationController
       ways = ways.where(:current_way_tags => { :k => type }) if type
       ways = ways.where(:current_way_tags => { :v => value }) if value
       ways = ways.limit(100)
+    else
+      ways = Array.new
     end
 
     # Matching for relation tags table
@@ -63,6 +68,8 @@ class SearchController < ApplicationController
       relations = relations.where(:current_relation_tags => { :k => type }) if type
       relations = relations.where(:current_relation_tags => { :v => value }) if value
       relations = relations.limit(2000)
+    else
+      relations = Array.new
     end
 
     # Fetch any node needed for our ways (only have matching nodes so far)
@@ -83,7 +90,7 @@ class SearchController < ApplicationController
     end
 
     relations.each do |rel|
-      doc.root << rel.to_xml_node(nil, changeset_cache, user_display_name_cache)
+      doc.root << rel.to_xml_node(changeset_cache, user_display_name_cache)
     end
 
     render :text => doc.to_s, :content_type => "text/xml"