X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/19965b2a5d89fdec9a6bb05f80b2b63dc632f267..9ec8ef0220bcc4b0f186bba4de354e2ce3e0504f:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 095ae4786..b7667b71d 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -794,31 +794,25 @@ end def sqlescape(a) - a.gsub(/[\000-\037]/,"").gsub("'","''").gsub(92.chr,92.chr+92.chr) + a.gsub(/[\000-\037]/,"").gsub("'","''").gsub(92.chr) {92.chr+92.chr} end def tag2array(a) tags={} - a.gsub(';;;','#%').split(';').each do |b| - b.gsub!('#%',';;;') - b.gsub!('===','#%') - k,v=b.split('=') - if k.nil? then k='' end - if v.nil? then v='' end - tags[k.gsub('#%','=').gsub(':','|')]=v.gsub('#%','=') + Tags.split(a) do |k, v| + tags[k.gsub(':','|')]=v end tags end def array2tag(a) - str='' + tags = [] a.each do |k,v| if v=='' then next end if v[0,6]=='(type ' then next end - if str!='' then str+=';' end - str+=k.gsub(';',';;;').gsub('=','===').gsub('|',':')+'='+v.gsub(';',';;;').gsub('=','===') + tags << [k.gsub('|',':'), v] end - str + return Tags.join(tags) end def getuserid(token)