Skip to content

Commit

Permalink
LPS-27280 - escape uploadProgressId and fileName in upload_progress_p…
Browse files Browse the repository at this point in the history
…oller
  • Loading branch information
ipeychev authored and brianchandotcom committed May 16, 2012
1 parent c0f9004 commit 9f561f3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion portal-web/docroot/html/portal/upload_progress_poller.jsp
Expand Up @@ -47,7 +47,19 @@ if (percent.floatValue() >= 100) {
<body>

<script type="text/javascript">
parent.<%= HtmlUtil.escape(uploadProgressId) %>.updateBar(<%= percent.intValue() %>, "<%= fileName %>");
;(function() {
var progressId = parent['<%= HtmlUtil.escapeJS(uploadProgressId) %>'];
var hasOwnProperty = Object.prototype.hasOwnProperty;
if (progressId && hasOwnProperty(progressId, 'updateBar')) {
var updateBar = progressId.updateBar;
if (typeof updateBar == 'function') {
progressId.updateBar(<%= percent.intValue() %>, "<%= HtmlUtil.escapeJS(fileName) %>");
}
}
}());
<c:if test="<%= percent.intValue() < 100 %>">
setTimeout("window.location.reload();", 1000);
Expand Down

0 comments on commit 9f561f3

Please sign in to comment.