added URLEncoder.encode to properly escape CGI encoded arguments so they are safely...
authorjprocter <Jim Procter>
Thu, 26 Jun 2008 17:13:17 +0000 (17:13 +0000)
committerjprocter <Jim Procter>
Thu, 26 Jun 2008 17:13:17 +0000 (17:13 +0000)
src/jalview/appletgui/AlignFrame.java

index 530b9a0..d7c2b43 100755 (executable)
@@ -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;