Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
If presumed URI does not decode, it's not a URI. Fixes #2264.
  • Loading branch information
headius committed Dec 2, 2014
1 parent 329bad2 commit f0aaf44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/org/jruby/util/JarResource.java
Expand Up @@ -24,6 +24,10 @@ public static JarResource create(String pathname) {
// since pathname is actually an uri we need to decode any url decoded characters like %20
// which happens when directory names contain spaces
sanitized = URLDecoder.decode(sanitized, "UTF-8");
} catch (IllegalArgumentException iae) {
// something in the path did not decode, so it's probably not a URI
// See jruby/jruby#2264.
return null;
} catch (UnsupportedEncodingException e) {
throw new RuntimeException( "hmm - system does not know UTF-8 string encoding :(" );
}
Expand Down

0 comments on commit f0aaf44

Please sign in to comment.