svn merge -c 1420232 FIXES: 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/branches/branch-2@1420233 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2012-12-11 15:51:12 +00:00
parent 42f6c0fd63
commit e2c0cf69ca
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(dateFormat.format(new Date(job.getFinishTime()))).append("\",\"")
.append("<a href='").append(url("job", job.getId())).append("'>") .append("<a href='").append(url("job", job.getId())).append("'>")
.append(job.getId()).append("</a>\",\"") .append(job.getId()).append("</a>\",\"")
.append(StringEscapeUtils.escapeHtml(job.getName())) .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
.append("\",\"") job.getName()))).append("\",\"")
.append(StringEscapeUtils.escapeHtml(job.getUserName())) .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
.append("\",\"") job.getUserName()))).append("\",\"")
.append(StringEscapeUtils.escapeHtml(job.getQueueName())) .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
.append("\",\"") job.getQueueName()))).append("\",\"")
.append(job.getState()).append("\",\"") .append(job.getState()).append("\",\"")
.append(String.valueOf(job.getMapsTotal())).append("\",\"") .append(String.valueOf(job.getMapsTotal())).append("\",\"")
.append(String.valueOf(job.getMapsCompleted())).append("\",\"") .append(String.valueOf(job.getMapsCompleted())).append("\",\"")

View File

@ -189,6 +189,9 @@ Release 0.23.6 - UNRELEASED
YARN-258. RM web page UI shows Invalid Date for start and finish times YARN-258. RM web page UI shows Invalid Date for start and finish times
(Ravi Prakash via jlowe) (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 Release 0.23.5 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

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