YARN-266. RM and JHS Web UIs are blank because AppsBlock is not escaping string properly. Contributed by Ravi Prakash

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1420232 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2012-12-11 15:45:10 +00:00
parent 99d072d072
commit b72b36009a
3 changed files with 15 additions and 12 deletions

View File

@ -78,12 +78,12 @@ public class HsJobsBlock extends HtmlBlock {
.append(dateFormat.format(new Date(job.getFinishTime()))).append("\",\"")
.append("<a href='").append(url("job", job.getId())).append("'>")
.append(job.getId()).append("</a>\",\"")
.append(StringEscapeUtils.escapeHtml(job.getName()))
.append("\",\"")
.append(StringEscapeUtils.escapeHtml(job.getUserName()))
.append("\",\"")
.append(StringEscapeUtils.escapeHtml(job.getQueueName()))
.append("\",\"")
.append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
job.getName()))).append("\",\"")
.append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
job.getUserName()))).append("\",\"")
.append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
job.getQueueName()))).append("\",\"")
.append(job.getState()).append("\",\"")
.append(String.valueOf(job.getMapsTotal())).append("\",\"")
.append(String.valueOf(job.getMapsCompleted())).append("\",\"")

View File

@ -206,6 +206,9 @@ Release 0.23.6 - UNRELEASED
YARN-258. RM web page UI shows Invalid Date for start and finish times
(Ravi Prakash via jlowe)
YARN-266. RM and JHS Web UIs are blank because AppsBlock is not escaping
string properly (Ravi Prakash via jlowe)
Release 0.23.5 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -84,12 +84,12 @@ class AppsBlock extends HtmlBlock {
appsTableData.append("[\"<a href='")
.append(url("app", appInfo.getAppId())).append("'>")
.append(appInfo.getAppId()).append("</a>\",\"")
.append(StringEscapeUtils.escapeHtml(appInfo.getUser()))
.append("\",\"")
.append(StringEscapeUtils.escapeHtml(appInfo.getName()))
.append("\",\"")
.append(StringEscapeUtils.escapeHtml(appInfo.getQueue()))
.append("\",\"")
.append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
appInfo.getUser()))).append("\",\"")
.append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
appInfo.getName()))).append("\",\"")
.append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
appInfo.getQueue()))).append("\",\"")
.append(appInfo.getStartTime()).append("\",\"")
.append(appInfo.getFinishTime()).append("\",\"")
.append(appInfo.getState()).append("\",\"")