From 586d7befce4afd782ce0b036f0dfd99c9ede22b6 Mon Sep 17 00:00:00 2001 From: Matt Amos Date: Tue, 28 Jul 2009 16:09:13 +0000 Subject: [PATCH] Fixed dumb-arse bug with wrong variable name. Added tag cleanup and checking on nodes which are part of ways (i.e: not 'POIs' in potlatch terminology). --- app/controllers/amf_controller.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 20053644d..aa030ca92 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -614,8 +614,8 @@ class AmfController < ApplicationController user = getuser(usertoken) if !user then return -1,"You are not logged in, so the way could not be saved." end if pointlist.length < 2 then return -2,"Server error - way is only #{points.length} points long." end - if !tags_ok(tags) then return -1,"One of the tags is invalid. Please pester Adobe to fix Flash on Linux." end - tags = strip_non_xml_chars tags + if !tags_ok(attributes) then return -1,"One of the tags is invalid. Please pester Adobe to fix Flash on Linux." end + attributes = strip_non_xml_chars attributes originalway = originalway.to_i pointlist.collect! {|a| a.to_i } @@ -640,6 +640,11 @@ class AmfController < ApplicationController node.lat = lat node.lon = lon node.tags = a[4] + + # fixup node tags in a way as well + if !tags_ok(node.tags) then return -1,"One of the tags is invalid. Please pester Adobe to fix Flash on Linux." end + node.tags = strip_non_xml_chars node.tags + node.tags.delete('created_by') node.version = version if id <= 0 -- 2.39.5