mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 07:01:19 +00:00
Bug 1548776 - URL-decode all file names in GeckoJarReader. r=snorp
Assuming the URL string the JAR reader receives has been completely URL-encoded, we need to decode not just the first nested jarUrl, as already happens through getZipFile(), but all subsequent path components, too. At least for jar:-URLs received from Gecko, the above assumption certainly seems to be true. Differential Revision: https://phabricator.services.mozilla.com/D44033 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
161a6ec7b4
commit
e417da9ac9
@ -23,8 +23,10 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Stack;
|
||||
|
||||
/* Reads out of a multiple level deep jar file such as
|
||||
@ -194,6 +196,11 @@ public final class GeckoJarReader {
|
||||
// loop through children jar files until we reach the innermost one
|
||||
while (!jarUrls.empty()) {
|
||||
String fileName = jarUrls.pop();
|
||||
try {
|
||||
fileName = URLDecoder.decode(fileName, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// UTF-8 is always supported
|
||||
}
|
||||
|
||||
if (inputStream != null) {
|
||||
// intermediate NativeZips and InputStreams will be garbage collected.
|
||||
|
Loading…
x
Reference in New Issue
Block a user