Skip to content

Commit

Permalink
[SPARK-39505][UI] Escape log content rendered in UI (apache#26)
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 apache#36902 from srowen/LogViewEscape.

Authored-by: Sean Owen <srowen@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 37dbf1c)

Co-authored-by: Sean Owen <srowen@gmail.com>
  • Loading branch information
2 people authored and GitHub AE committed Nov 1, 2022
1 parent bc8ea45 commit 900f761
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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 @@ -112,7 +112,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 900f761

Please sign in to comment.