Commit d042fa04 authored by Sunil Kumar's avatar Sunil Kumar
Browse files

Fix Bug DSMLWriter did not support pre-defined entities in XML (<, > ). (ITS#3102).

parent 0df870c0
...@@ -152,6 +152,14 @@ public class DSMLWriter implements LDAPWriter { ...@@ -152,6 +152,14 @@ public class DSMLWriter implements LDAPWriter {
out.write("</searchResponse>"); out.write("</searchResponse>");
newLine(0); newLine(0);
out.write("</batchResponse>"); out.write("</batchResponse>");
break;
case NEW_BATCH:
//if no message is send, we assume
//batch response.
out.write("<batchResponse>");
newLine(0);
out.write("</batchResponse>");
break;
} }
newLine(0); newLine(0);
out.flush(); out.flush();
...@@ -1272,7 +1280,13 @@ public class DSMLWriter implements LDAPWriter { ...@@ -1272,7 +1280,13 @@ public class DSMLWriter implements LDAPWriter {
newLine(4); newLine(4);
if (Base64.isValidUTF8(bytevalues[i], false)){ if (Base64.isValidUTF8(bytevalues[i], false)){
out.write("<value>"); out.write("<value>");
out.write(values[i]); String xmlvalue = values[i];
xmlvalue = xmlvalue.replaceAll("&", "&amp;");
xmlvalue = xmlvalue.replaceAll("<", "&lt;");
xmlvalue = xmlvalue.replaceAll(">", "&gt;");
xmlvalue = xmlvalue.replaceAll("'", "&apos");
xmlvalue = xmlvalue.replaceAll("\"", "&quot;");
out.write(xmlvalue);
out.write("</value>"); out.write("</value>");
} else { } else {
out.write("<value xsi:type=\"xsd:base64Binary\">"); out.write("<value xsi:type=\"xsd:base64Binary\">");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment