diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 9f003cd8a3b..a8fa5fd367e 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -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(); }