Time condition exclude invalid presets with incorrect json syntax to make it more resilient.
This commit is contained in:
parent
3f7697b59d
commit
6c50deee2c
|
|
@ -49,10 +49,13 @@
|
|||
$preset_region = "preset_".$_SESSION['time_conditions']['region']['text'];
|
||||
if (is_array($_SESSION['time_conditions'][$preset_region])) {
|
||||
foreach ($_SESSION['time_conditions'][$preset_region] as $json) {
|
||||
$available_presets[] = json_decode($json, true);
|
||||
$json_array = json_decode($json, true);
|
||||
if (is_array($json_array)) {
|
||||
$available_presets[] = $json_array;
|
||||
$valid_presets[] = array_key_first(end($available_presets));
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($preset_region);
|
||||
|
||||
//set the action as an add or an update
|
||||
|
|
|
|||
Loading…
Reference in New Issue