Jelajahi Sumber

HUE-1873 [beeswax] Result data not HTML encoded

Metastore sample date tab is fine.
Romain Rigaux 12 tahun lalu
induk
melakukan
968d58c
1 mengubah file dengan 6 tambahan dan 2 penghapusan
  1. 6 2
      apps/beeswax/src/beeswax/templates/execute.mako

+ 6 - 2
apps/beeswax/src/beeswax/templates/execute.mako

@@ -1428,10 +1428,14 @@ function resultsTable(e, data) {
         reinitializeTable();
       },
       "fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
-        // Make sure null values are seen as NULL.
+        // Make sure null values are seen as NULL and are escaped.
+        var tmpDiv = $('<div />');
         for (var j = 0; j < aData.length; ++j) {
+          var cell = $(nRow).find('td:eq(' + j + ')');
           if (aData[j] == null) {
-            $(nRow).find('td:eq(' + j + ')').html("NULL");
+            cell.html("NULL");
+          } else {
+            cell.html(tmpDiv.text(cell.html()).html());
           }
         }
         return nRow;