fix ugliness in release history of help.jsp

[yes, i am still alive *g*]
This commit is contained in:
mihi
2005-12-23 04:36:31 +00:00
committed by zzz
parent 784d465d17
commit dc0485b526

View File

@ -51,7 +51,19 @@ public class ContentHelper {
String str = FileUtil.readTextFile(_page, _maxLines, _startAtBeginning);
if (str == null)
return "";
else
return "<pre>" + str + "</pre>";
else {
StringBuffer sb = new StringBuffer(str.length()+11);
sb.append("<pre>");
for (int i=0; i < str.length(); i++) {
char c = str.charAt(i);
switch (str.charAt(i)) {
case '<': sb.append("&lt;"); break;
case '>': sb.append("&gt;"); break;
case '&': sb.append("&amp;"); break;
default: sb.append(c); break;
}
}
return sb.append("</pre>").toString();
}
}
}