aboutsummaryrefslogtreecommitdiffstats
path: root/fop-core
diff options
context:
space:
mode:
Diffstat (limited to 'fop-core')
-rw-r--r--fop-core/src/main/java/org/apache/fop/apps/io/InternalResourceResolver.java2
-rw-r--r--fop-core/src/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java5
2 files changed, 7 insertions, 0 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/apps/io/InternalResourceResolver.java b/fop-core/src/main/java/org/apache/fop/apps/io/InternalResourceResolver.java
index 470f2e4ba..1fe530bd3 100644
--- a/fop-core/src/main/java/org/apache/fop/apps/io/InternalResourceResolver.java
+++ b/fop-core/src/main/java/org/apache/fop/apps/io/InternalResourceResolver.java
@@ -133,6 +133,8 @@ public class InternalResourceResolver {
}
String fixedUri = uriStr.replace('\\', '/');
fixedUri = fixedUri.replace(" ", "%20");
+ fixedUri = fixedUri.replace("{", "%7B");
+ fixedUri = fixedUri.replace("}", "%7D");
URI baseURI = new URI(fixedUri);
return baseURI;
}
diff --git a/fop-core/src/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java b/fop-core/src/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java
index 5bab320f6..ffb477a73 100644
--- a/fop-core/src/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java
+++ b/fop-core/src/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java
@@ -120,6 +120,11 @@ public class URIResolverWrapperTestCase {
assertNull(InternalResourceResolver.cleanURI(null));
}
+ @Test
+ public void testCurlyBrackets() throws Exception {
+ assertEquals(InternalResourceResolver.cleanURI("{test}.jpg"), new URI("%7Btest%7D.jpg"));
+ }
+
private void test(String uriStr, URI uri, URI expected) throws IOException, URISyntaxException {
ResourceResolver resolver = mock(ResourceResolver.class);
InternalResourceResolver sut = new InternalResourceResolver(base, resolver);