From: jprocter Date: Thu, 26 Jun 2008 17:13:17 +0000 (+0000) Subject: added URLEncoder.encode to properly escape CGI encoded arguments so they are safely... X-Git-Tag: Release_2_4~93 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=10c2447aefb29bddf48799fb5a1631932a5940a8;p=jalview.git added URLEncoder.encode to properly escape CGI encoded arguments so they are safely transmitted to the launchApp servlet. --- diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 530b9a0..d7c2b43 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -1037,7 +1037,16 @@ public class AlignFrame try { new URL(url); + url = URLEncoder.encode(url); } + /* When we finally deprecate 1.1 compatibility, + * we can start to use URLEncoder.encode(url,"UTF-8") + * and then we'll need this catch: + * catch (UnsupportedEncodingException ex) + { + System.err.println("WARNING - IMPLEMENTATION ERROR - UNSUPPORTED ENCODING EXCEPTION FOR "+url); + ex.printStackTrace(); + } */ catch (java.net.MalformedURLException ex) { url = viewport.applet.getCodeBase() + url;