Fix XSS in normalization.js
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
This commit is contained in:
parent
b3d36dc836
commit
f33a42f1da
@ -243,6 +243,24 @@ function escapeHtml(unsafe) {
|
||||
}
|
||||
}
|
||||
|
||||
function escapeJsString(unsafe) {
|
||||
if (typeof(unsafe) != 'undefined') {
|
||||
return unsafe
|
||||
.toString()
|
||||
.replace("\000", '')
|
||||
.replace('\\', '\\\\')
|
||||
.replace('\'', '\\\'')
|
||||
.replace("'", "\\\'")
|
||||
.replace('"', '\"')
|
||||
.replace(""", "\"")
|
||||
.replace("\n", '\n')
|
||||
.replace("\r", '\r')
|
||||
.replace(/<\/script/gi, '</\' + \'script')
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function PMA_sprintf() {
|
||||
return sprintf.apply(this, arguments);
|
||||
}
|
||||
|
||||
@ -638,7 +638,7 @@ AJAX.registerOnload('normalization.js', function() {
|
||||
'</ol>';
|
||||
$("#newCols").html(confirmStr);
|
||||
$('.tblFooters').html('<input type="submit" value="' + PMA_messages.strCancel + '" onclick="$(\'#newCols\').html(\'\');$(\'#extra input[type=checkbox]\').removeAttr(\'checked\')"/>' +
|
||||
'<input type="submit" value="' + PMA_messages.strGo + '" onclick="moveRepeatingGroup(\'' + repeatingCols + '\')"/>');
|
||||
'<input type="submit" value="' + PMA_messages.strGo + '" onclick="moveRepeatingGroup(\'' + escapeJsString(escapeHtml(repeatingCols)) + '\')"/>');
|
||||
}
|
||||
});
|
||||
$("#mainContent p").on("click", "#createPrimaryKey", function(event) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user