From fa1397e988a252ec21548bfd575af3afce6bcc16 Mon Sep 17 00:00:00 2001 From: Richard Fairhurst Date: Fri, 13 Jul 2007 09:46:39 +0000 Subject: [PATCH] strip out any control characters before writing to the db --- app/controllers/amf_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 5fe9b45cb..18a1c6346 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -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 @@ -404,6 +405,8 @@ EOF 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 -- 2.43.2