Skip to content

Commit

Permalink
Merge pull request #3628 from cnsgithub/fixes-3623-terminal
Browse files Browse the repository at this point in the history
fixes #3623 - XSS in terminal
  • Loading branch information
tandraschko committed May 2, 2018
2 parents a3f90e4 + 52dd59c commit 1d6df4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -118,7 +118,7 @@ protected void handleCommand(FacesContext context, Terminal terminal) throws IOE
String result = (String) commandHandler.invoke(context.getELContext(), new Object[]{command, args});

ResponseWriter writer = context.getResponseWriter();
writer.write(result);
writer.writeText(result, null);
}

protected void autoCompleteCommand(FacesContext context, Terminal terminal) throws IOException {
Expand Down
Expand Up @@ -211,10 +211,10 @@ PrimeFaces.widget.Terminal = PrimeFaces.widget.BaseWidget.extend({
* Internally used to add the content from the ajax response to the terminal.
* Can also be used e.g. by a websocket.
*
* @param {string} content
* @param {string} HTML escaped content
*/
processResponse: function(content) {
$('<div></div>').text(content).appendTo(this.content.children().last());
$('<div>' + content + '</div>').appendTo(this.content.children().last());

// always scroll down to the last item
this.jq.scrollTop(this.jq[0].scrollHeight);
Expand Down

0 comments on commit 1d6df4c

Please sign in to comment.