CVE-2012-1621: Escape errors returned from ajax calls in the checkout pages

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1302218 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Scott Gray
2012-03-18 20:31:10 +00:00
parent 54bb3ef632
commit fa9a794cc4
@@ -144,11 +144,12 @@ function getServerError(data) {
if (data._ERROR_MESSAGE_LIST_ != undefined) {
serverErrorHash = data._ERROR_MESSAGE_LIST_;
jQuery.each(serverErrorHash, function(i, error) {
serverError += error.message + '<br/>';
var encodedErrorMessage = jQuery('<div/>').text(error.message).html();
serverError += encodedErrorMessage + '<br/>';
});
}
if (data._ERROR_MESSAGE_ != undefined) {
serverError = data._ERROR_MESSAGE_;
serverError = jQuery('<div/>').text(data._ERROR_MESSAGE_).html();
}
return serverError;
}