From 12c5ddb7199f168007aedc98d0fe8e3657e04a03 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 5 Jun 2010 21:31:38 +0000 Subject: [PATCH] fix bug git-svn-id: https://osmand.googlecode.com/svn/trunk@141 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- OsmAnd/src/com/osmand/views/OsmBugsLayer.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/com/osmand/views/OsmBugsLayer.java b/OsmAnd/src/com/osmand/views/OsmBugsLayer.java index 92b2b5ebc6..74b6e9df38 100644 --- a/OsmAnd/src/com/osmand/views/OsmBugsLayer.java +++ b/OsmAnd/src/com/osmand/views/OsmBugsLayer.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; +import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -259,8 +260,8 @@ public class OsmBugsLayer implements OsmandMapLayer { b.append("lat=").append(latitude); b.append("&lon=").append(longitude); text = text + " [" + authorName +" "+ dateFormat.format(new Date())+ "]"; - b.append("&text=").append(text); - b.append("&name=").append(authorName); + b.append("&text=").append(URLEncoder.encode(text)); + b.append("&name=").append(URLEncoder.encode(authorName)); return editingPOI(b.toString(), "creating bug"); } @@ -269,8 +270,8 @@ public class OsmBugsLayer implements OsmandMapLayer { b.append("http://openstreetbugs.schokokeks.org/api/0.1/editPOIexec?"); b.append("id=").append(id); text = text + " [" + authorName +" "+ dateFormat.format(new Date())+ "]"; - b.append("&text=").append(text); - b.append("&name=").append(authorName); + b.append("&text=").append(URLEncoder.encode(text)); + b.append("&name=").append(URLEncoder.encode(authorName)); return editingPOI(b.toString(), "adding comment"); } @@ -283,8 +284,8 @@ public class OsmBugsLayer implements OsmandMapLayer { private boolean editingPOI(String urlStr, String debugAction){ - urlStr = urlStr.replace(" ", "%20"); try { + log.debug("Action " + debugAction + " " + urlStr); URL url = new URL(urlStr); URLConnection connection = url.openConnection(); BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); @@ -300,7 +301,6 @@ public class OsmBugsLayer implements OsmandMapLayer { return false; } - protected List loadingBugs(double topLatitude, double leftLongitude, double bottomLatitude,double rightLongitude){ List bugs = new ArrayList(); StringBuilder b = new StringBuilder();