Skip to content

Commit

Permalink
[SPARK-39505][UI] Escape log content rendered in UI
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Escape log content rendered to the UI.

### Why are the changes needed?

Log content may contain reserved characters or other code in the log and be misinterpreted in the UI as HTML.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Existing tests

Closes #36902 from srowen/LogViewEscape.

Authored-by: Sean Owen <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
srowen committed Jun 17, 2022
1 parent 380177d commit 07edae9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function loadMore() {
if (retStartByte == 0) {
disableMoreButton();
}
$("pre", ".log-content").prepend(cleanData);
$("pre", ".log-content").prepend(document.createTextNode(cleanData));

curLogLength = curLogLength + (startByte - retStartByte);
startByte = retStartByte;
Expand Down Expand Up @@ -115,7 +115,7 @@ function loadNew() {
var retLogLength = dataInfo[2];

var cleanData = data.substring(newlineIndex + 1);
$("pre", ".log-content").append(cleanData);
$("pre", ".log-content").append(document.createTextNode(cleanData));

curLogLength = curLogLength + (retEndByte - retStartByte);
endByte = retEndByte;
Expand Down

0 comments on commit 07edae9

Please sign in to comment.