diff --git a/bundles/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java b/bundles/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java
index 45d6c697a1db3d6002f51e3c8c9ad7586a3626a0..3145cacc2cec13fd54889fc124f14f5cce9b1848 100644
--- a/bundles/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java
+++ b/bundles/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java
@@ -916,4 +916,18 @@ public class CommonUtils {
public static boolean isValidIndex(int index, int length) {
return index >= 0 || index < length;
}
+
+ @NotNull
+ public static String escapeHtml(@Nullable String text) {
+ if (text == null) {
+ return " ";
+ }
+ return text
+ .replace("&", "&")
+ .replace("<", "<")
+ .replace(">", ">")
+ .replace("\r\n", "
")
+ .replace("\r", "
")
+ .replace("\n", "
");
+ }
}
diff --git a/plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/stream/exporter/DataExporterHTML.java b/plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/stream/exporter/DataExporterHTML.java
index 1cd858f70eb6bff55f9de10df88ec4cd55495e17..a5b739313cf288e99b046d82b7b298c23a39dd65 100644
--- a/plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/stream/exporter/DataExporterHTML.java
+++ b/plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/stream/exporter/DataExporterHTML.java
@@ -31,10 +31,7 @@ import org.jkiss.utils.CommonUtils;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Reader;
+import java.io.*;
import java.util.Map;
/**
@@ -164,24 +161,14 @@ public class DataExporterHTML extends StreamExporterAbstract {
private void writeTableTitle(String value, int columns) {
PrintWriter out = getWriter();
out.write(String.format("