]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
Fix bad database query for RSS feeds of trace file tags
[rails.git] / app / controllers / trace_controller.rb
index dbb8a6f2cb8ef4144e4e8d2eb47863fcb2b0d743..d709b5cf10991433840cff8c64d3ee6efa5bd281 100644 (file)
@@ -163,7 +163,7 @@ class TraceController < ApplicationController
     trace = Trace.find(params[:id])
 
     if trace.visible? and (trace.public? or (@user and @user == trace.user))
-      if Acl.match(request.remote_ip).where(:k => "no_trace_download").exists?
+      if Acl.no_trace_download(request.remote_ip)
         render :nothing => true, :status => :forbidden
       elsif request.format == Mime::XML
         send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => Mime::XML.to_s, :disposition => 'attachment')
@@ -224,7 +224,7 @@ class TraceController < ApplicationController
     end
 
     if params[:tag]
-      traces = traces.where("EXISTS (SELECT * FROM gpx_file_tags AS gft WHERE gft.gpx_id = gpx_files.id AND gft.tag = ?)")
+      traces = traces.where("EXISTS (SELECT * FROM gpx_file_tags AS gft WHERE gft.gpx_id = gpx_files.id AND gft.tag = ?)", params[:tag])
     end
 
     traces = traces.order("timestamp DESC")