]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/amf_controller.rb
Use a full path to find the file command.
[rails.git] / app / controllers / amf_controller.rb
index 1049b51b61d0735cb28d31986815df51c1d1005c..18a1c63469b6ce91c1a04c31b370552af1e9cb3c 100644 (file)
@@ -288,6 +288,7 @@ EOF
       ymin=[ys,ymin].min; ymax=[ys,ymax].max
       node=points[i][2].to_i
       tagstr=array2tag(points[i][4])
+         tagstr=tagstr.gsub(/[\000-\037]/,"")
       tagsql="'"+sqlescape(tagstr)+"'"
 
       # compare node
@@ -400,10 +401,12 @@ EOF
     insertsql =''
     currentsql=''
     attributes.each do |k,v|
-      if v=='' then next end
+      if v=='' or v.nil? then next end
       if v[0,6]=='(type ' then next end
       if insertsql !='' then insertsql +=',' end
       if currentsql!='' then currentsql+=',' end
+         k=k.gsub(/[\000-\037]/,"")
+         v=v.gsub(/[\000-\037]/,"")
       insertsql +="(#{way},'"+sqlescape(k)+"','"+sqlescape(v)+"',#{version})"
       currentsql+="(#{way},'"+sqlescape(k)+"','"+sqlescape(v)+"')"
     end