Skip to content

Commit

Permalink
Properly escape string into XML entities #131
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Dec 19, 2023
1 parent a458ac1 commit 99b4fff
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package io.github.basilapi.basil.rendering;

import java.beans.XMLEncoder;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -26,6 +27,7 @@

import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.jena.riot.RDFFormat;

import com.google.gson.JsonArray;
Expand All @@ -35,6 +37,7 @@
import org.apache.jena.query.ResultSet;
import org.apache.jena.query.ResultSetFormatter;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.riot.RDFWriter;
import org.apache.jena.sparql.resultset.CSVOutput;
import org.apache.jena.sparql.resultset.JSONOutput;
import org.apache.jena.sparql.resultset.XMLOutput;
Expand Down Expand Up @@ -129,7 +132,7 @@ public String render(MediaType type, String g, Map<String, String> pref) throws
p.append("<");
p.append(v);
p.append(">");
p.append(n.toString());
p.append(StringEscapeUtils.escapeXml11(n.toString()));
p.append("</");
p.append(v);
p.append(">");
Expand Down

0 comments on commit 99b4fff

Please sign in to comment.