From 74795b87e543cf566b9e277d60ce23f871d7c7e8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 31 Jan 2021 12:46:54 +0100 Subject: [PATCH] FIX avoid undefined url and missing token --- htdocs/core/js/lib_head.js.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 382f12840d7..7d2888e870e 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -529,6 +529,7 @@ function hideMessage(fieldId,message) { * @param string token Token */ function setConstant(url, code, input, entity, strict, forcereload, userid, token) { + var $url = url; /* avoid undefined url */ $.post( url, { action: "set", name: code, @@ -573,11 +574,12 @@ function setConstant(url, code, input, entity, strict, forcereload, userid, toke $.each(data, function(key, value) { $("#set_" + key).hide(); $("#del_" + key).show(); - $.get( url, { + $.post( $url, { action: "set", name: key, value: value, - entity: entity + entity: entity, + token: token }); }); } @@ -602,6 +604,7 @@ function setConstant(url, code, input, entity, strict, forcereload, userid, toke * @param string token Token */ function delConstant(url, code, input, entity, strict, forcereload, userid, token) { + var $url = url; /* avoid undefined url */ $.post( url, { action: "del", name: code, @@ -643,10 +646,11 @@ function delConstant(url, code, input, entity, strict, forcereload, userid, toke $.each(data, function(key, value) { $("#del_" + value).hide(); $("#set_" + value).show(); - $.get( url, { + $.get( $url, { action: "del", name: value, - entity: entity + entity: entity, + token: token }); }); }