X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/4cd7f5ad0d982260e0ef5e9b0d9781d4ae05f295..250bb47cc2723c7af6fac0a6e9e900c1a50f9292:/app/controllers/amf_controller.rb?ds=sidebyside diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 5e57fde5b..9dd0e909e 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -321,12 +321,12 @@ class AmfController < ApplicationController # Ideally we would do ":include => :nodes" here but if we do that # then rails only seems to return the first copy of a node when a # way includes a node more than once - way = Way.where(:id => wayid).preload(:nodes => :node_tags).first + way = Way.where(:id => wayid).first # check case where way has been deleted or doesn't exist return [-4, 'way', wayid] if way.nil? or !way.visible - points = way.nodes.collect do |node| + points = way.nodes.preload(:node_tags).collect do |node| nodetags=node.tags nodetags.delete('created_by') [node.lon, node.lat, node.id, nodetags, node.version] @@ -551,7 +551,7 @@ class AmfController < ApplicationController mid = renumberedways[mid] if m[0] == 'Way' end if mid - typedmembers << [m[0], mid, strip_non_xml_chars(m[2])] + typedmembers << [m[0], mid, m[2].delete("\000-\037\ufffe\uffff", "^\011\012\015")] end end @@ -886,8 +886,8 @@ class AmfController < ApplicationController new_tags = Hash.new unless tags.nil? tags.each do |k, v| - new_k = k.delete "\000-\037", "^\011\012\015" - new_v = v.delete "\000-\037", "^\011\012\015" + new_k = k.delete "\000-\037\ufffe\uffff", "^\011\012\015" + new_v = v.delete "\000-\037\ufffe\uffff", "^\011\012\015" new_tags[new_k] = new_v end end