diff --git a/projects/samskivert/src/java/com/samskivert/servlet/util/HTMLUtil.java b/projects/samskivert/src/java/com/samskivert/servlet/util/HTMLUtil.java index e7458c1d..7df37fc0 100644 --- a/projects/samskivert/src/java/com/samskivert/servlet/util/HTMLUtil.java +++ b/projects/samskivert/src/java/com/samskivert/servlet/util/HTMLUtil.java @@ -39,10 +39,18 @@ public class HTMLUtil { // this could perhaps be done more efficiently, but this function // is not likely to be called on large quantities of text + // (first we turn the entified versions normal so that if text is + // repeatedly run through this it doesn't keep changing successive + // &'s into "&". + text = StringUtil.replace(text, """, "\""); + text = StringUtil.replace(text, ">", ">"); + text = StringUtil.replace(text, "<", "<"); + text = StringUtil.replace(text, "&", "&"); text = StringUtil.replace(text, "&", "&"); text = StringUtil.replace(text, "<", "<"); text = StringUtil.replace(text, ">", ">"); - return StringUtil.replace(text, "\"", """); + text = StringUtil.replace(text, "\"", """); + return text; } /**