FIx arrap_map to array_map. Don't assume _REQUEST[mids] exists. Fixes #3859

pull/3862/head
Isaac Connor 2024-03-10 10:59:56 -04:00
parent f0088e49d7
commit b647280766
1 changed files with 9 additions and 8 deletions

View File

@ -21,12 +21,11 @@ require_once('includes/Zone.php');
global $error_message;
global $redirect;
if ($action == 'delete') {
if (isset($_REQUEST['markZids'])) {
$monitors_to_restart = array();
foreach ($_REQUEST['markZids'] as $markZid) {
$zone = new ZM\Zone($markZid);
$zone = new ZM\Zone(validCardinal($markZid));
if (!$zone->Id()) {
$error_message .= 'Zone not found for id ' . $markZid.'<br/>';
continue;
@ -41,14 +40,16 @@ if ($action == 'delete') {
$error_message .= $zone->delete();
} # end foreach Zone
if (daemonCheck()) {
foreach ($monitors_to_restart as $monitor) {
if ( daemonCheck() and ($monitor->Type() != 'WebSite') ) {
if ($monitor->Type() != 'WebSite') {
$monitor->zmcControl('restart');
} // end if daemonCheck()
}
}
}
$refreshParent = true;
if (!$error_message)
$redirect = '?view=zones&'.implode('&', array_map(function($mid){ return 'mids[]='.$mid; }, $_REQUEST['mids']));
$redirect = '?view=zones'.(isset($_REQUEST['mids']) ? '&'.implode('&', array_map(function($mid){ return 'mids[]='.$mid; }, $_REQUEST['mids'])): '');
} else {
$error_message .= 'No Zones marked for deletion.<br/>';
} // end if isset($_REQUEST['markZids'])