File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
java/org/apache/commons/text/lookup
resources/org/apache/commons/text Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,14 @@ void testInterpolatorExternalEntityOnOverride() {
9999 () -> stringSubstitutor .replace ("${xml:secure=true:" + DOC_DIR + "document-entity-ref.xml:/document/content}" ));
100100 }
101101
102+ @ Test
103+ void testInterpolatorSecureOnBla () {
104+ final StringSubstitutor stringSubstitutor = StringSubstitutor .createInterpolator ();
105+ assertThrows (IllegalArgumentException .class , () -> stringSubstitutor .replace ("${xml:" + DOC_DIR + "bla.xml:/document/content}" ));
106+ assertThrows (IllegalArgumentException .class , () -> stringSubstitutor .replace ("${xml:secure=true:" + DOC_DIR + "bla.xml:/document/content}" ));
107+ // Using secure=false allows the BLA to occur.
108+ }
109+
102110 @ Test
103111 void testMissingXPath () {
104112 assertThrows (IllegalArgumentException .class , () -> XmlStringLookup .INSTANCE .apply (DOC_RELATIVE + ":!JUNK!" ));
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <!DOCTYPE lolz [
3+ <!ENTITY lol " lol" >
4+ <!ELEMENT lolz (#PCDATA)>
5+ <!ENTITY lol1 " &lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol; " >
6+ <!ENTITY lol2 " &lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1; " >
7+ <!ENTITY lol3 " &lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2; " >
8+ <!ENTITY lol4 " &lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3; " >
9+ <!ENTITY lol5 " &lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4; " >
10+ <!ENTITY lol6 " &lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5; " >
11+ <!ENTITY lol7 " &lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6; " >
12+ <!ENTITY lol8 " &lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7; " >
13+ <!ENTITY lol9 " &lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8; " >
14+ ]>
15+ <lolz >&lol9; </lolz >
You can’t perform that action at this time.
0 commit comments