Commit 85e4bef0 authored by Franco Fichtner's avatar Franco Fichtner

system: protect all JS with html_safe(); closes #1285

parent 235049b9
...@@ -387,14 +387,14 @@ $( document ).ready(function() { ...@@ -387,14 +387,14 @@ $( document ).ready(function() {
event.preventDefault(); event.preventDefault();
BootstrapDialog.show({ BootstrapDialog.show({
type:BootstrapDialog.TYPE_DANGER, type:BootstrapDialog.TYPE_DANGER,
title: "<?= gettext("Certificate");?>", title: "<?= html_safe(gettext('Certificate')) ?>",
message: "<?=gettext("Do you really want to remove this certificate association?") .'\n'. gettext("(Certificate will not be deleted)");?>", message: "<?= html_safe(gettext('Do you really want to remove this certificate association?')) .'\n'. html_safe(gettext('(Certificate will not be deleted)')) ?>",
buttons: [{ buttons: [{
label: "<?= gettext("No");?>", label: "<?= html_safe(gettext('No')) ?>",
action: function(dialogRef) { action: function(dialogRef) {
dialogRef.close(); dialogRef.close();
}}, { }}, {
label: "<?= gettext("Yes");?>", label: "<?= html_safe(gettext('Yes')) ?>",
action: function(dialogRef) { action: function(dialogRef) {
$("#certid").val(certid); $("#certid").val(certid);
$("#act").val("delcert"); $("#act").val("delcert");
...@@ -411,14 +411,14 @@ $( document ).ready(function() { ...@@ -411,14 +411,14 @@ $( document ).ready(function() {
event.preventDefault(); event.preventDefault();
BootstrapDialog.show({ BootstrapDialog.show({
type:BootstrapDialog.TYPE_DANGER, type:BootstrapDialog.TYPE_DANGER,
title: "<?= gettext("User");?>", title: "<?= html_safe(gettext('User')) ?>",
message: "<?=html_safe(gettext('Do you really want to delete this user?'));?>" + "<br/>("+username+")", message: "<?= html_safe(gettext('Do you really want to delete this user?')) ?>" + "<br/>("+username+")",
buttons: [{ buttons: [{
label: "<?= gettext("No");?>", label: "<?= html_safe(gettext('No')) ?>",
action: function(dialogRef) { action: function(dialogRef) {
dialogRef.close(); dialogRef.close();
}}, { }}, {
label: "<?= gettext("Yes");?>", label: "<?= html_safe(gettext('Yes')) ?>",
action: function(dialogRef) { action: function(dialogRef) {
$("#userid").val(userid); $("#userid").val(userid);
$("#act2").val("deluser"); $("#act2").val("deluser");
...@@ -438,7 +438,7 @@ $( document ).ready(function() { ...@@ -438,7 +438,7 @@ $( document ).ready(function() {
url="system_usermanager_import_ldap.php"; url="system_usermanager_import_ldap.php";
var oWin = window.open(url,"OPNsense","width=620,height=400,top=150,left=150,scrollbars=yes"); var oWin = window.open(url,"OPNsense","width=620,height=400,top=150,left=150,scrollbars=yes");
if (oWin==null || typeof(oWin)=="undefined") { if (oWin==null || typeof(oWin)=="undefined") {
alert("<?=gettext('Popup blocker detected. Action aborted.');?>"); alert("<?= html_safe(gettext('Popup blocker detected. Action aborted.')) ?>");
} }
}); });
...@@ -472,14 +472,14 @@ $( document ).ready(function() { ...@@ -472,14 +472,14 @@ $( document ).ready(function() {
var apiKey = $(this).data('key'); var apiKey = $(this).data('key');
BootstrapDialog.show({ BootstrapDialog.show({
type:BootstrapDialog.TYPE_DANGER, type:BootstrapDialog.TYPE_DANGER,
title: "<?= gettext("User");?>", title: "<?= html_safe(gettext('User')) ?>",
message: '<?=gettext("Do you really want to delete this API key?");?>' + '<br/><small>('+apiKey.substring(0,40)+"...)</small>", message: '<?= html_safe(gettext('Do you really want to delete this API key?')) ?>' + '<br/><small>('+apiKey.substring(0,40)+"...)</small>",
buttons: [{ buttons: [{
label: "<?= gettext("No");?>", label: "<?= html_safe(gettext('No')) ?>",
action: function(dialogRef) { action: function(dialogRef) {
dialogRef.close(); dialogRef.close();
}}, { }}, {
label: "<?= gettext("Yes");?>", label: "<?= html_safe(gettext('Yes')) ?>",
action: function(dialogRef) { action: function(dialogRef) {
$("#act").val("delApiKey"); $("#act").val("delApiKey");
$("#api_delete").val(apiKey); $("#api_delete").val(apiKey);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment