Restrict imported tag values to 255 characters
authorRichard Fairhurst <richard@systemeD.net>
Mon, 3 Oct 2011 13:09:41 +0000 (14:09 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Mon, 3 Oct 2011 13:09:41 +0000 (14:09 +0100)
net/systemeD/halcyon/connection/Trace.as
net/systemeD/potlatch2/utils/GpxImporter.as
net/systemeD/potlatch2/utils/KmlImporter.as
net/systemeD/potlatch2/utils/OsmImporter.as

index 8a4199e..07eca87 100644 (file)
@@ -141,7 +141,7 @@ package net.systemeD.halcyon.connection {
             for each (var wpt:XML in file.wpt) {
                 var tags:Object = {};
                 for each (var tag:XML in wpt.children()) {
-                    tags[tag.name().localName]=tag.toString();
+                    tags[tag.name().localName]=tag.toString().substr(0,255);
                 }
                 var node:Node = connection.createNode(tags, wpt.@lat, wpt.@lon, action.push);
                                connection.registerPOI(node);
index c3d6419..5f0816c 100644 (file)
@@ -39,7 +39,7 @@ package net.systemeD.potlatch2.utils {
             for each (var wpt:XML in file.wpt) {
                                var tags:Object = {};
                                for each (var tag:XML in wpt.children()) {
-                                       tags[tag.name().localName]=tag.toString();
+                                       tags[tag.name().localName]=tag.toString().substr(0,255);
                                }
                                var node:Node = connection.createNode(tags, wpt.@lat, wpt.@lon, push);
                                connection.registerPOI(node);
index cfed833..302fa8f 100644 (file)
@@ -32,11 +32,11 @@ package net.systemeD.potlatch2.utils {
                 var tags:Object = {};
 
                 if (placemark.name.length() > 0) {
-                    tags["name"] = placemark.name;
+                    tags["name"] = placemark.name.substr(0,255);
                 }
 
                 if (placemark.description.length() > 0) {
-                    tags["description"] = placemark.description;
+                    tags["description"] = placemark.description.substr(0,255);
                 }
 
                 for each (var point:XML in placemark.Point) {
index c3d84f2..19b2b51 100644 (file)
@@ -55,7 +55,7 @@ package net.systemeD.potlatch2.utils {
         private function parseTags(tagElements:XMLList):Object {
             var tags:Object = {};
             for each (var tagEl:XML in tagElements)
-                tags[tagEl.@k] = tagEl.@v;
+                tags[tagEl.@k] = tagEl.@v.substr(0,255);
             return tags;
         }