aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/apps/FOURIResolver.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/apps/FOURIResolver.java b/src/java/org/apache/fop/apps/FOURIResolver.java
index a2b70346f..5a72e2d12 100644
--- a/src/java/org/apache/fop/apps/FOURIResolver.java
+++ b/src/java/org/apache/fop/apps/FOURIResolver.java
@@ -110,8 +110,12 @@ public class FOURIResolver
String scheme = baseURL.getProtocol() + ":";
if (href.startsWith(scheme)) {
href = href.substring(scheme.length());
- if ("file:".equals(scheme) && href.indexOf(':') >= 0) {
- href = "/" + href; //Absolute file URL doesn't have a leading slash
+ if ("file:".equals(scheme)) {
+ int colonPos = href.indexOf(':');
+ int slashPos = href.indexOf('/');
+ if (slashPos >= 0 && colonPos >= 0 && colonPos < slashPos) {
+ href = "/" + href; //Absolute file URL doesn't have a leading slash
+ }
}
}
absoluteURL = new URL(baseURL, href);