/hg/icedtea-web: Ensure document-base is properly encoded
adomurad at icedtea.classpath.org
adomurad at icedtea.classpath.org
Tue Apr 23 10:46:41 PDT 2013
changeset 9d17ddb0003f in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=9d17ddb0003f
author: Adam Domurad <adomurad at redhat.com>
date: Tue Apr 23 13:47:42 2013 -0400
Ensure document-base is properly encoded
diffstat:
ChangeLog | 8 ++++++++
netx/net/sourceforge/jnlp/cache/ResourceTracker.java | 5 ++++-
plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 3 +--
3 files changed, 13 insertions(+), 3 deletions(-)
diffs (50 lines):
diff -r b16893fb126a -r 9d17ddb0003f ChangeLog
--- a/ChangeLog Tue Apr 23 13:39:45 2013 -0400
+++ b/ChangeLog Tue Apr 23 13:47:42 2013 -0400
@@ -1,3 +1,11 @@
+2013-04-23 Adam Domurad <adomurad at redhat.com>
+
+ Ensure document-base is properly encoded.
+ * netx/net/sourceforge/jnlp/cache/ResourceTracker.java
+ (getCacheFile): Use URL#toUri().getPath() instead of URL#getFile().
+ * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
+ (handleInitializationMessage): Don't decode document-base.
+
2013-04-23 Adam Domurad <adomurad at redhat.com>
Reproducer for URL parameters (eg ?a=b) in document-base.
diff -r b16893fb126a -r 9d17ddb0003f netx/net/sourceforge/jnlp/cache/ResourceTracker.java
--- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java Tue Apr 23 13:39:45 2013 -0400
+++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java Tue Apr 23 13:47:42 2013 -0400
@@ -398,7 +398,7 @@
return resource.localFile;
if (location.getProtocol().equalsIgnoreCase("file")) {
- File file = new File(location.getFile());
+ File file = new File(location.toURI().getPath());
if (file.exists())
return file;
}
@@ -409,6 +409,9 @@
ex.printStackTrace();
return null; // need an error exception to throw
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ return null;
}
}
diff -r b16893fb126a -r 9d17ddb0003f plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Tue Apr 23 13:39:45 2013 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Tue Apr 23 13:47:42 2013 -0400
@@ -439,8 +439,7 @@
String height = msgParts[2];
int spaceLocation = message.indexOf(' ', "tag".length() + 1);
- String documentBase =
- UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation));
+ String documentBase = message.substring("tag".length() + 1, spaceLocation);
String paramString = message.substring(spaceLocation + 1);
PluginDebug.debug("Handle = ", handle, "\n",
More information about the distro-pkg-dev
mailing list