Skip to content

Commit f933e5e

Browse files
o Updated to remove '<!--' and '-->' from XML comments to guard against XML
XML injection issues. Fixes #3
1 parent fcd94e5 commit f933e5e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/org/codehaus/plexus/util/xml/XmlWriterUtil.java

+10
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,16 @@ public static void writeComment( XMLWriter writer, String comment, int indent, i
186186
comment = "null";
187187
}
188188

189+
while ( comment.contains( "<!--" ) )
190+
{
191+
comment = comment.replace( "<!--", "" );
192+
}
193+
194+
while ( comment.contains( "-->" ) )
195+
{
196+
comment = comment.replace( "-->", "" );
197+
}
198+
189199
if ( indent < 0 )
190200
{
191201
indent = 0;

0 commit comments

Comments
 (0)