mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4115 - xss in web demos
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1399577 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
65af81e09e
commit
51eb87a84b
|
@ -29,7 +29,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
// this allows to display debug logs directly on the web page
|
// this allows to display debug logs directly on the web page
|
||||||
client.debug = function(str) {
|
client.debug = function(str) {
|
||||||
$("#debug").append(str + "\n");
|
$("#debug").append(document.createTextNode(str + "\n"));
|
||||||
};
|
};
|
||||||
// the client is notified when it is connected to the server.
|
// the client is notified when it is connected to the server.
|
||||||
var onconnect = function(frame) {
|
var onconnect = function(frame) {
|
||||||
|
@ -39,7 +39,7 @@ $(document).ready(function(){
|
||||||
$('#send_form_input').removeAttr('disabled');
|
$('#send_form_input').removeAttr('disabled');
|
||||||
|
|
||||||
client.subscribe(destination, function(message) {
|
client.subscribe(destination, function(message) {
|
||||||
$("#messages").append("<p>" + message.body + "</p>\n");
|
$("#messages").append(document.createTextNode("<p>" + message.body + "</p>\n"));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
client.connect(login, passcode, onconnect);
|
client.connect(login, passcode, onconnect);
|
||||||
|
|
|
@ -70,7 +70,8 @@ public class PortfolioPublishServlet extends MessageServletSupport {
|
||||||
}
|
}
|
||||||
out.print(refreshRate);
|
out.print(refreshRate);
|
||||||
out.println("'/></head>");
|
out.println("'/></head>");
|
||||||
out.println("<body>Published <b>" + count + "</b> of " + total + " price messages. Refresh = " + refreshRate + "s");
|
out.println("<body>Published <b>" + escape(Integer.toString(count)) + "</b> of " + escape(Integer.toString(total))
|
||||||
|
+ " price messages. Refresh = " + escape(refreshRate) + "s");
|
||||||
out.println("</body></html>");
|
out.println("</body></html>");
|
||||||
|
|
||||||
} catch (JMSException e) {
|
} catch (JMSException e) {
|
||||||
|
@ -129,4 +130,8 @@ public class PortfolioPublishServlet extends MessageServletSupport {
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String escape(String text) throws IOException {
|
||||||
|
return java.net.URLEncoder.encode(text, "UTF-8");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue