[Web] Fix some empty responses in alert box

master
andryyy 2021-08-15 20:19:28 +02:00
parent 2dfcfd16d0
commit d6eb21f7a6
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 4 additions and 2 deletions

View File

@ -695,6 +695,9 @@ function alertbox_log_parser($_data) {
if (isset($lang[$return['type']][$return['msg']])) { if (isset($lang[$return['type']][$return['msg']])) {
$msg = $lang[$return['type']][$return['msg']]; $msg = $lang[$return['type']][$return['msg']];
} }
else {
$msg = $return['msg'];
}
} }
// If msg is an array, use first element as language string and run printf on it with remaining array elements // If msg is an array, use first element as language string and run printf on it with remaining array elements
elseif (is_array($return['msg'])) { elseif (is_array($return['msg'])) {
@ -704,9 +707,8 @@ function alertbox_log_parser($_data) {
$return['msg'] $return['msg']
); );
} }
// If none applies, use msg as returned message
else { else {
$msg = $return['msg']; $msg = '-';
} }
$log_array[] = array('msg' => $msg, 'type' => json_encode($type)); $log_array[] = array('msg' => $msg, 'type' => json_encode($type));
} }