Merge branch 'new-website-security-const' of github.com:Hystepik/dolibarr into new-website-security-const

This commit is contained in:
Hystepik 2025-02-11 14:46:55 +01:00
commit cbf8d6ae01

View File

@ -2978,6 +2978,8 @@ if ($action == 'generatesitemaps' && $usercanedit) {
if ($action == 'removecspsource' && $usercanedit) {
$db->begin();
$sourcetype = "";
$sourcecsp = explode("_", GETPOST("sourcecsp"));
$directive = $sourcecsp[0];
$sourcekey = !empty($sourcecsp[1]) ? $sourcecsp[1] : null;
@ -2992,7 +2994,7 @@ if ($action == 'removecspsource' && $usercanedit) {
$error++;
}
$directivetype = $directivesarray[$directive]["data-directivetype"];
$directivetype = (string) $directivesarray[$directive]["data-directivetype"];
if (isset($sourcekey)) {
$sourcetype = $sourcesarray[$directivetype][$sourcekey]["data-sourcetype"];
}
@ -3048,6 +3050,7 @@ if ($action == 'removecspsource' && $usercanedit) {
$db->rollback();
setEventMessages($langs->trans("ErrorRemovingSecurityPolicy"), null, 'errors');
}
header("Location: ".$_SERVER["PHP_SELF"].'?websiteid='.$websiteid."&action=editsecurity");
exit();
}